|
|
SEPTEMBER 13, 2014 6 COMMENTS4 O' h8 i& k& X! c2 D
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.
( K+ u' y0 v$ ^. j& M3 z5 B1 CInstalling Mininet on CentOS74 l$ ]/ W, r- u% k0 `% u$ Z! U0 Z
– I needed VM with 2GB memory to get OS installed.4 g) d" j% h [1 z9 Z6 N' d
– I used CentOS-7.0-1406-x86_64-livecd.iso to install the VM. I’m not going to outline steps for installing CentOS./ y$ T% a2 E0 M
– I created a local user called mininet and gave it sudo access and ran the remainder as that user.5 A, c4 d9 O8 s0 V
– Install SSHD* t8 g( q" x ?% u& M7 i2 L8 `% R
sudo yum -y install openssh-server# T' r& d6 o& K2 J% ]
sudo chkconfig sshd on
{3 M. J% ~# T( j s# Y$ F5 l6 [sudo service sshd start0 j( [7 T% Z" l8 j: F2 |* z
– Disable SELinux to get OVSDB to stasrt
7 l+ x$ g1 s# X* F7 L4 Qsudo setenforce Permissive
! [$ g; \! G- d) u5 q– Modify sudoers secure_path to add /usr/local/bin so the ‘controller’ which be found.
' i" h* O. v" Y2 bDefaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin6 ~0 ~( G& T% X- I+ M
– Install GIT
( O9 @4 T& e7 o$ C1 z$ K) Ssudo yum -y install git0 d" Z# U3 N3 X/ d C% V# P: U u
– Get Mininet.+ E8 e# O, r& I) E7 ?7 e
git clone git://github.com/mininet/mininet.git
6 ~/ D6 @3 F3 ^. v% I; a– Update installer mininet/util/install.sh.
5 f+ d# U. }/ {$ v1 } K. T: ]6 l***ADD the following before the line ‘test -e /etc/fedora-release && DIST=”Fedora”‘. Somewhere around line 47. May differ.
- v3 C$ i( e0 w# S9 Dtest -e /etc/centos-release && DIST="CentOS"
1 O- k" y# P u+ Iif [ "$DIST" = "CentOS" ]; then% V2 r0 {0 \) t0 ~4 A
install='sudo yum -y install'
) d' B+ C, K. |* O& b8 [, H6 q remove='sudo yum -y erase'
. Z: d \* w3 b! y pkginst='sudo rpm -ivh'
6 d4 z$ D9 `0 O9 `6 x# Q # Prereqs for this script
& h1 j1 Z, b# V4 J4 }$ D; C if ! which lsb_release &> /dev/null; then
/ Y) p# ]9 Q8 } $install redhat-lsb-core; R7 y, s7 @& ^; T
fi
0 T J7 k$ b/ [; z& ?fi
) E/ \& A* {. M$ d$ o***EDIT
! Q$ B6 ?% c/ n: L6 pif ! echo $DIST | egrep 'Ubuntu|Debian|Fedora|CentOS'; then0 J) ^; J* T4 V( m
echo "Install.sh currently only supports Ubuntu, Debian and Fedora."0 V6 A; m- D; t/ c6 R. V; |- k( K
exit 1( P1 v* K$ W! Z6 D4 U! P3 G
fi& E6 i6 [' j+ j: e: ?) Z
– Install Mininet and OpenFlow reference. Not OVS.* J% Y& Q9 }, E8 k1 N A
mininet/util/install.sh -nf
* x, }: |3 F& ]9 H+ s– Build and Install OVS' B; v g* o) L; o
sudo yum -y install gcc make python-devel openssl-devel kernel-devel graphviz \
% Y& y0 T7 p# ^6 y/ bkernel-debug-devel autoconf automake rpm-build redhat-rpm-config \. R. y4 V- b* C" ]; Z$ h1 U* R0 `
libtool wget
/ e7 G8 R9 m4 H; O. Y2 i
5 Z$ X9 P; b8 }# }. t8 U8 Vmkdir -p /home/mininet/rpmbuild/SOURCES/7 o3 F0 `; ]6 e
cd /home/mininet/rpmbuild/SOURCES/( z3 E$ q k1 Q W# M! k! S
wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz" j& T# g. O9 v8 @' J
tar zxvf openvswitch-2.3.0.tar.gz5 c2 g/ B6 u- y& _
cd openvswitch-2.3.0
$ i5 p3 z) k' arpmbuild -bb --without check rhel/openvswitch.spec
1 m0 L8 P; q, }sudo rpm -ivh --nodeps /home/mininet/rpmbuild/RPMS/x86_64/openvswitch*.rpm- L: U) U# m2 `6 d) E d7 \, F
– Start OVS
3 X( r/ x& s. X) t9 E9 r$ N6 o3 Rsudo /etc/init.d/openvswitch start
7 ?0 g! w! i. r– Check working# u" r' _8 N7 j4 }3 Z2 |- J
[mininet@localhost ~]$ sudo ovs-vsctl show
" I* B, L- n0 u7 y+ h76ed3664-6b6b-4325-85c1-c9a2bf735e30
2 U0 y/ k( O! B& G9 l2 b! i ovs_version: "2.3.0"$ M, p& Y/ E: Y6 p5 D! T! B& S
– Test out Mininet
7 s& R- P( p4 G% {[mininet@localhost ~]$ sudo mn --test pingall( [ A( f0 p3 u8 l! B& \0 E M/ \
*** Creating network
* p, [8 I: U! G*** Adding controller
3 X; M$ b; e/ L*** Adding hosts:
2 l( ?* W) D, _0 Bh1 h28 s" _7 `) m0 l; u9 z W
*** Adding switches:/ S8 @* s/ P& D, u @3 Z9 S
s1. ]- a$ ]+ Y( m* b7 G
*** Adding links:! \6 O2 I6 a% |' ]: s6 Z
(h1, s1) (h2, s1)- p2 y5 t% l" v% v+ R$ b" m
*** Configuring hosts
- ]8 `5 R3 v& X4 b+ S }h1 h2$ `' c: n! ^7 x3 _
*** Starting controller
- M6 Z! K* F% | C2 h" Z( \*** Starting 1 switches/ ?1 T) {4 `; `+ P% i+ r r
s1* f4 q6 q/ F2 e
*** Waiting for switches to connect
Q* L j" E9 d$ w# cs16 t/ i5 i" s4 m$ _" F
*** Ping: testing ping reachability4 c5 B. N/ f% b5 N/ a4 S
h1 -> h2/ C3 `5 Y2 L8 W! v- ?( Z2 z
h2 -> h1
0 s5 x# I/ _8 S# T o*** Results: 0% dropped (2/2 received)
# l4 e$ Z+ w; r. _# g7 }*** Stopping 1 controllers1 ]7 \. A8 P# X
c0
0 d5 u% c. _6 y' n+ P*** Stopping 1 switches" P, d& X# Y$ u) g1 i
s1 ..: `4 m$ z; h9 G7 w* X' b& |6 a
*** Stopping 2 hosts
+ g3 P5 X0 `- m v) p9 ]* k! t. yh1 h2/ t5 \; U% F/ J0 u
*** Done! z: P0 s8 g! k! k. j/ ]+ N6 o
completed in 5.397 seconds2 U- {/ Y* T+ H: |; v0 ]5 B
So it seems to work. But there are a few things to note.
. ^+ G( I" t8 T2 l1. 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.
0 e; F2 W0 t) K# P/ @( J2. The above is the extent of the testing I did. There may be other issues that crop up.4 L# E3 q! C8 a2 P) d( b
Hope this helps anyone that uses CentOS or RHEL 7 with Mininet.3 J5 [, D( S: S
" d4 C7 q# z& z5 |+ YThis post ‘Mininet and OVS on CentOS 7’ first appeared on https://techandtrains.com/. |
|