- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
SEPTEMBER 13, 2014 6 COMMENTS
* c8 D# ]" F/ Q$ ?# D5 H! v, o! K, }The following are the steps I took to get Mininet running in CentOS 7. I ran into many issues trying to get OVS installed and running. There was a conflict between the OVS script tools starting OVSDB and SELinux. I had to set SELinux to Passive to work around it. So depending on what system you are running this on, be advised of the following steps and what system level settings I changed for security. I assume most of these will be corrected once OVS officially supports CentOS/RHEL 7.
% T! `: r% k6 C( a- ]. l: TInstalling Mininet on CentOS73 p3 z$ C. g- O: d& k2 b5 B1 h
– I needed VM with 2GB memory to get OS installed.
6 `7 L: v2 F- f$ [– I used CentOS-7.0-1406-x86_64-livecd.iso to install the VM. I’m not going to outline steps for installing CentOS.# {+ V2 B) \% ^% D# {2 A4 x: _
– I created a local user called mininet and gave it sudo access and ran the remainder as that user.& |$ g8 u E& z; j7 }8 ~
– Install SSHD
! X( F6 p2 a) v4 |sudo yum -y install openssh-server0 V& g& X. R, v
sudo chkconfig sshd on
3 ]5 R+ _9 P- d% P9 f6 `% C' \sudo service sshd start0 _5 a* ]: f& _+ M" b
– Disable SELinux to get OVSDB to stasrt5 s2 T2 v8 g: a0 w3 C! K
sudo setenforce Permissive
. R& \2 F+ }2 ?' g– Modify sudoers secure_path to add /usr/local/bin so the ‘controller’ which be found.2 W( R$ j5 y: n q: o
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin5 V- r$ P4 w V: w7 b% a1 w
– Install GIT
0 V5 [6 [ j4 S+ j+ p; Osudo yum -y install git
/ f9 `2 C2 ~# W– Get Mininet." Z& [; _- J) J# o) P5 Z
git clone git://github.com/mininet/mininet.git
6 y4 D' g# a% h) O5 |– Update installer mininet/util/install.sh.( H* d, b/ w V/ i: t/ p
***ADD the following before the line ‘test -e /etc/fedora-release && DIST=”Fedora”‘. Somewhere around line 47. May differ.9 I9 `; u2 U7 Q$ {
test -e /etc/centos-release && DIST="CentOS"7 a$ ^4 q& V/ R, O% t
if [ "$DIST" = "CentOS" ]; then0 {! A9 |/ G+ M! B2 F( _1 h- `3 y
install='sudo yum -y install'. C. b, X6 n9 e% w+ C( b
remove='sudo yum -y erase'
0 ~5 a( R X1 R) U3 U. b" W pkginst='sudo rpm -ivh'
" T F* q, R: P2 y9 h2 Q, [# Y6 t # Prereqs for this script
# F, M V N! M* J# I! Y; j' J: z# D if ! which lsb_release &> /dev/null; then( l! X6 {4 g& J o; B
$install redhat-lsb-core( Y. T- l0 @) E7 ?1 k6 r- V N
fi& G* a' p$ s% b6 v; v
fi; g* O2 Q1 U" b0 r9 s4 P8 \+ z# ^
***EDIT+ R0 a6 J* k! X- Q1 p
if ! echo $DIST | egrep 'Ubuntu|Debian|Fedora|CentOS'; then9 q% A# U9 x& B9 k7 K
echo "Install.sh currently only supports Ubuntu, Debian and Fedora."
9 l4 r9 x) J: i# [ exit 1: F5 ~) }1 s9 i" \
fi n+ ^; {0 a/ v' E" b
– Install Mininet and OpenFlow reference. Not OVS.7 B& Q1 f6 i1 A2 o
mininet/util/install.sh -nf7 z7 i+ W7 r! L& _# o; t& `$ ~
– Build and Install OVS
5 S2 L! a' P' }; s) @: h/ \* Y* Jsudo yum -y install gcc make python-devel openssl-devel kernel-devel graphviz \
2 L3 C; s3 i" X/ _kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \5 n" C7 X. Y$ p: ?: Z
libtool wget4 p4 `8 V( ^$ v+ Q
- q7 G4 G+ j( ]/ r
mkdir -p /home/mininet/rpmbuild/SOURCES/
. |; q) A/ E+ E! [cd /home/mininet/rpmbuild/SOURCES/
6 S8 F! b8 U' e* ^- d6 B) j3 }wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz8 w0 x. d$ [! w9 N( F
tar zxvf openvswitch-2.3.0.tar.gz4 W' g( S! J* \; u2 q. L# R: J
cd openvswitch-2.3.0% C$ V3 S( B5 z
rpmbuild -bb --without check rhel/openvswitch.spec5 y, d, g: Q/ r/ q" N
sudo rpm -ivh --nodeps /home/mininet/rpmbuild/RPMS/x86_64/openvswitch*.rpm( W# z& H. E, |6 s
– Start OVS
# Z8 A1 D a; i+ dsudo /etc/init.d/openvswitch start
- S" s1 R6 R. T) K- C4 f/ m, h5 G– Check working
& g6 [0 c2 t3 B: g/ p' \[mininet@localhost ~]$ sudo ovs-vsctl show
, o! L) m6 h* ~+ H9 }$ W4 p76ed3664-6b6b-4325-85c1-c9a2bf735e307 p. S+ j7 f5 m0 ~" i2 T" W
ovs_version: "2.3.0"
1 T* K; p! ?5 t3 _* W" i; \) t– Test out Mininet' V# ~: {* a- A/ k
[mininet@localhost ~]$ sudo mn --test pingall
) l# \) P0 h- l: ?* I7 B*** Creating network5 K% i8 i& ? ?% a1 |. B; ^
*** Adding controller& t8 [: j( s3 ]1 m& m5 k: I ?
*** Adding hosts:& [# @0 Z( J7 V% i; c) q. d
h1 h2# g8 \/ b: s1 Q4 I; d) q/ m
*** Adding switches:
5 k/ q1 }8 l" }* l" A- U+ ws11 L8 W# o" q4 f
*** Adding links:/ ^) L! t* }4 d8 I" x
(h1, s1) (h2, s1)+ I6 O8 _$ d( ^6 f2 k: F1 X0 W1 P {
*** Configuring hosts" T7 X0 d- x) K, [- B
h1 h27 T/ Q; |4 h5 C' W# _9 I
*** Starting controller
7 M, h/ |; Q& g# L$ t8 j4 q& }7 [*** Starting 1 switches
5 L# A, d W7 T/ }6 Zs1& D4 e4 q" f3 _: ^5 n' ?. N% L" n$ n
*** Waiting for switches to connect) v! x* o: a+ k& Z1 b$ f# i4 w
s1
+ k6 _! Z& E" i( }& U. A$ @*** Ping: testing ping reachability4 h1 s8 Y4 ^. E y6 B$ [
h1 -> h2
# s1 v: z1 Y4 y0 {h2 -> h1 k* \) t5 R9 r/ Y: s
*** Results: 0% dropped (2/2 received)
8 q2 l: d( j+ [, x! ~7 h5 j/ m5 N*** Stopping 1 controllers9 t& T7 s- f" N5 D* ]" M% X0 P7 w3 x
c00 E4 L+ G' h. x4 E, I6 }
*** Stopping 1 switches
6 z% L. m7 Q7 @0 Ys1 ..0 b! M$ {5 @. Q
*** Stopping 2 hosts" ?# _$ y- X5 ~" ~8 \& _
h1 h2
* @- F4 k* h( t. E7 X1 D, P% R*** Done; m( {- B. L4 \. M X& z* R
completed in 5.397 seconds
7 {2 o0 R/ C3 B7 Z4 |) \5 `5 c3 n1 m* KSo it seems to work. But there are a few things to note.
4 t, o3 N: q7 b! C% h. Q; D1 A$ d1. The kernel datapath is not installed. This is totally userspace. I could not get the kernel module to compile. Wait until official support of RHEL7.9 P' \# p" |* N
2. The above is the extent of the testing I did. There may be other issues that crop up. }1 z" g( [6 m1 m1 f, I1 @
Hope this helps anyone that uses CentOS or RHEL 7 with Mininet.
2 L& z G% @) h6 D( ]+ {# w : R2 p5 I$ ~1 h- r1 R+ I: n# h o f
This post ‘Mininet and OVS on CentOS 7’ first appeared on https://techandtrains.com/. |
|