|
|
SEPTEMBER 13, 2014 6 COMMENTS
7 F: X- I) y+ [3 A' }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.
7 G; j, q! e! G8 a5 HInstalling Mininet on CentOS73 t2 M. E: |) ?* _9 X) `1 `& [+ S. J
– I needed VM with 2GB memory to get OS installed.
! x7 t* V% H: r5 U* W1 c– I used CentOS-7.0-1406-x86_64-livecd.iso to install the VM. I’m not going to outline steps for installing CentOS.
9 P: y# m4 H8 @! y+ o3 x– I created a local user called mininet and gave it sudo access and ran the remainder as that user.
" x7 ]2 o& t( V– Install SSHD
1 W, K1 R1 w" X: d/ V5 Dsudo yum -y install openssh-server
$ E+ T& U8 w( s, ~2 E. {sudo chkconfig sshd on% z% B# u; \) z0 V% m
sudo service sshd start
( O. @% u, Z5 `; b. [4 ^– Disable SELinux to get OVSDB to stasrt3 v4 c! r- n3 y+ a" ?7 e9 I
sudo setenforce Permissive2 a4 R5 K* x3 E# y5 t) u! ]
– Modify sudoers secure_path to add /usr/local/bin so the ‘controller’ which be found.
9 k2 B6 w7 m* n7 F% {/ \Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin3 t1 g+ l- ^' H3 X
– Install GIT( n, e0 x S* ^5 K; d6 f, U
sudo yum -y install git
8 ]- U. D0 o4 u7 B– Get Mininet.9 v7 s6 l4 ]( V/ n1 o/ Z1 K
git clone git://github.com/mininet/mininet.git; x) |! H c1 X2 {4 F! ~
– Update installer mininet/util/install.sh.
1 Y# O+ e) c# I3 [***ADD the following before the line ‘test -e /etc/fedora-release && DIST=”Fedora”‘. Somewhere around line 47. May differ.% n$ U9 m# g1 ]8 q
test -e /etc/centos-release && DIST="CentOS"
8 b6 Q4 j) H$ f& W2 O9 wif [ "$DIST" = "CentOS" ]; then
/ h, k7 k. }* { install='sudo yum -y install'
1 Y! ?. E7 Y' h" {4 o5 ? remove='sudo yum -y erase'
% G/ Q6 n8 E+ e7 v2 ]6 ? pkginst='sudo rpm -ivh'
^0 T& g3 B$ I% n5 m # Prereqs for this script
4 b9 x. c% l/ Z4 u8 f1 n8 D1 F if ! which lsb_release &> /dev/null; then9 Y# @, | q( L5 q- G& Z8 |6 _
$install redhat-lsb-core" T6 O9 L0 D8 N* @$ v% R1 I% P
fi
4 y& t* ?$ _% g2 T" @' @fi
( y, }- [& k, O, ^6 O/ n" W***EDIT0 M1 [" v2 t0 @9 C( P
if ! echo $DIST | egrep 'Ubuntu|Debian|Fedora|CentOS'; then5 c8 K, B& @* M7 k* ]
echo "Install.sh currently only supports Ubuntu, Debian and Fedora."" u5 e+ r8 s* ]+ d$ O$ o' b
exit 1' A9 L, G5 w- p" K- e; E
fi! g0 t5 W2 ?( A' V& z0 Q# f
– Install Mininet and OpenFlow reference. Not OVS.( v- g& Z8 z5 r. J5 J; f. l
mininet/util/install.sh -nf
' c" B# f* Z0 g( Q3 z( z– Build and Install OVS
+ |* f- w# d0 `% T3 xsudo yum -y install gcc make python-devel openssl-devel kernel-devel graphviz \
1 A6 m+ }. L/ N [, ^# o% Q7 ?5 ekernel-debug-devel autoconf automake rpm-build redhat-rpm-config \- b. T2 P3 O) Z1 W; E, t: S7 g+ C
libtool wget/ y/ c {" R' m' H
6 F; W6 j7 s9 v& s9 u% @8 g+ u8 |
mkdir -p /home/mininet/rpmbuild/SOURCES/; p+ b" \+ g8 R. O# P
cd /home/mininet/rpmbuild/SOURCES/$ x! y6 w! I" e) ~7 v
wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
$ B' o T$ S) q1 Ztar zxvf openvswitch-2.3.0.tar.gz
' y, a( x4 O7 ]cd openvswitch-2.3.0
( f5 \9 G# o3 v- y* ]8 W$ lrpmbuild -bb --without check rhel/openvswitch.spec
, A% X. H' L$ ^. M" J- _sudo rpm -ivh --nodeps /home/mininet/rpmbuild/RPMS/x86_64/openvswitch*.rpm$ @/ E, }' Y7 q$ v+ [9 D1 ]
– Start OVS
8 j1 i: H. v/ T L& Z& Esudo /etc/init.d/openvswitch start7 C0 ^' d) R1 r
– Check working9 e! Y, a6 }, _$ l) D4 D
[mininet@localhost ~]$ sudo ovs-vsctl show5 n- u% Z! K8 {' b9 p
76ed3664-6b6b-4325-85c1-c9a2bf735e30
0 }# x( C# o `& f! M2 f0 g ovs_version: "2.3.0"" z- N, O) z& a
– Test out Mininet
! x& V4 W' ^3 r- v: X; O; c' D[mininet@localhost ~]$ sudo mn --test pingall7 u! ^# G( f5 \' r7 V& m
*** Creating network
5 ~0 D @* J+ n/ c8 Q0 l*** Adding controller
`; M" D0 T& ?/ Y8 X2 Z! G*** Adding hosts:
. R$ e' O( G8 K$ h9 d8 b$ @* Uh1 h2
: ~! [; M; e! M3 O5 `*** Adding switches:
6 l; l o8 P+ ? p: d/ Vs1
0 y/ ]5 }, ~9 k2 O" ]*** Adding links:
1 V& }/ _/ a4 R(h1, s1) (h2, s1)
/ q: s7 y8 E0 k! L% j# [7 U j! T*** Configuring hosts
- C6 [' ~7 S5 L" y, `h1 h2) y; }' l1 \: _' |: B& C1 p: E, t
*** Starting controller% U& Y! B" Q( L( o* _! o0 l
*** Starting 1 switches8 W# W5 u% C0 k2 n- q0 o( d
s1( s+ H3 k4 l$ \
*** Waiting for switches to connect
- x5 o0 G9 _. c) L9 ks18 \) E( U2 a" q! `; ?
*** Ping: testing ping reachability L3 d) n8 s' u7 f& P
h1 -> h2
* `! ?3 ]7 {% a0 _h2 -> h1
* W2 a3 B) c6 A+ t# U) n' ~7 ^) k*** Results: 0% dropped (2/2 received)
! r9 `. f( y9 W$ R( Y' j*** Stopping 1 controllers x4 V* l! t% {/ B, n
c0
: v$ p1 {: f0 ^/ ~" [*** Stopping 1 switches
% K6 W5 ]$ ^4 I/ H0 G. d! Ts1 ..1 C' T/ S" p) F9 q+ K
*** Stopping 2 hosts( P+ l; o) C1 M' ~+ P% u0 E1 G0 }. c
h1 h2
9 I, W; m \. ?# O*** Done! u* R1 i7 I. m2 F; m6 P
completed in 5.397 seconds( @* R$ d& G0 c2 F
So it seems to work. But there are a few things to note." J- `' o# R) T( r
1. 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.
, @& S2 t) h) I& Q2. The above is the extent of the testing I did. There may be other issues that crop up.% K: R! x, M$ n' C. w( o
Hope this helps anyone that uses CentOS or RHEL 7 with Mininet.( b8 [9 d+ N+ t- p+ E9 c; \
( J0 P6 U2 |$ g
This post ‘Mininet and OVS on CentOS 7’ first appeared on https://techandtrains.com/. |
|