- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
SEPTEMBER 13, 2014 6 COMMENTS# w8 l) A* g1 {% b0 M/ N2 j) g
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.
5 Z7 ?9 K1 w6 \) \5 q8 pInstalling Mininet on CentOS7" m) w! y3 r. S
– I needed VM with 2GB memory to get OS installed.
, u3 z$ x }8 @– I used CentOS-7.0-1406-x86_64-livecd.iso to install the VM. I’m not going to outline steps for installing CentOS.
2 `2 T( g" U- I– I created a local user called mininet and gave it sudo access and ran the remainder as that user. r4 o7 o9 d, j4 g
– Install SSHD }, `2 y' N' K- r8 G+ V' o
sudo yum -y install openssh-server5 C9 p8 z* y8 _0 @
sudo chkconfig sshd on
) ?3 ^ u5 S# A" Ysudo service sshd start4 _+ F) p$ C) h
– Disable SELinux to get OVSDB to stasrt
( {8 p" {) h. [# gsudo setenforce Permissive& s4 m# M8 S! u2 g$ A" Q
– Modify sudoers secure_path to add /usr/local/bin so the ‘controller’ which be found.) ]! ~/ q, r6 ~9 D( r0 {: [
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
5 d: v+ G2 {5 C. l0 \3 v P9 R# h9 ~– Install GIT4 A( H/ a5 x8 k( P# p
sudo yum -y install git) o. }; ?- A& Z9 n( A. n. W
– Get Mininet.
0 y! V. ~4 B; E4 t4 ngit clone git://github.com/mininet/mininet.git) g4 o7 |& ]- B4 A) q* F7 _
– Update installer mininet/util/install.sh.; b# I! I0 n( E7 K2 ?
***ADD the following before the line ‘test -e /etc/fedora-release && DIST=”Fedora”‘. Somewhere around line 47. May differ.
' @! G2 y, C0 ~& R0 @0 l0 \test -e /etc/centos-release && DIST="CentOS"! c! W3 r! `# a& ^# P
if [ "$DIST" = "CentOS" ]; then7 G& O$ l$ a1 G& I5 m
install='sudo yum -y install'# n3 Z6 Q$ Y$ H1 q; l$ h4 y
remove='sudo yum -y erase'
0 J+ k, |) q1 h6 L6 }5 k$ n! L pkginst='sudo rpm -ivh'! ~# N k# L, N; f$ t: ?; ^. n
# Prereqs for this script
0 m2 }& l( a0 ~ if ! which lsb_release &> /dev/null; then" B! }" M% f' W; ?1 X
$install redhat-lsb-core* w: U0 P {. b( f; S
fi
& c: T* Y7 h% a' f, g& @5 Wfi( a+ i+ U% [2 q6 ~
***EDIT3 Q! `6 Y& y: } H
if ! echo $DIST | egrep 'Ubuntu|Debian|Fedora|CentOS'; then
7 l/ K0 `, n* r9 I+ j echo "Install.sh currently only supports Ubuntu, Debian and Fedora."( S+ t8 ]/ q) R( ~+ R& p
exit 1% _- k7 u- F+ z2 T. N
fi
" `4 y2 H' o( u& y– Install Mininet and OpenFlow reference. Not OVS.
, c; ]8 r4 m% \- m8 Tmininet/util/install.sh -nf
n8 F7 Y9 G, @# N8 T* P. ]– Build and Install OVS C6 H& s% @8 `& V0 p/ M$ F" `
sudo yum -y install gcc make python-devel openssl-devel kernel-devel graphviz \
! X( U, ?6 ^5 X8 Vkernel-debug-devel autoconf automake rpm-build redhat-rpm-config \7 i Q6 I; E7 N' z! s+ V2 ?
libtool wget
( O+ G2 D4 d6 ?* N( k
! l- N9 }7 v4 V5 ~( Jmkdir -p /home/mininet/rpmbuild/SOURCES/: V1 o5 u; f1 \3 L% f
cd /home/mininet/rpmbuild/SOURCES/4 r9 d# o7 m1 \
wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
( ?3 Z* b0 J- f, h0 c7 ]" _tar zxvf openvswitch-2.3.0.tar.gz) j' S$ u! s% E- p+ [. L
cd openvswitch-2.3.0
$ g2 l% a2 z& {1 _: _% Arpmbuild -bb --without check rhel/openvswitch.spec* {( t4 b9 G1 O- U
sudo rpm -ivh --nodeps /home/mininet/rpmbuild/RPMS/x86_64/openvswitch*.rpm
# a/ q9 x, U' k' G8 f– Start OVS. ` P( \1 E# Z6 w* @" q( n
sudo /etc/init.d/openvswitch start( C- O) C. r3 o8 E' S( w, W
– Check working+ [$ h/ p6 d) O1 |3 D- k
[mininet@localhost ~]$ sudo ovs-vsctl show
. E% p5 B+ P( V0 n& V# T- S7 b% |' o7 ]76ed3664-6b6b-4325-85c1-c9a2bf735e30- e4 u' G9 H' S5 y" O. U7 }8 M
ovs_version: "2.3.0"
, g2 q. v O0 w& ]1 y- P8 Y– Test out Mininet7 ~# ` i5 k f; y) \" \2 w+ W' q
[mininet@localhost ~]$ sudo mn --test pingall
+ Y6 Z$ @; R* [: ^. \2 l*** Creating network0 H6 X% I/ E0 {( R; Q( }
*** Adding controller5 D2 v& L6 z+ L M" d
*** Adding hosts:3 Y; N8 e' q7 `* h' h) C( z" s0 z
h1 h2% j2 y3 J- f( _, H y5 @
*** Adding switches:1 j+ p/ \) O% @' s
s1
; {$ P8 w5 |) L* _* E- r*** Adding links:
5 ^1 b5 b! @$ G, Q- N' ^' w2 X(h1, s1) (h2, s1)
9 K3 I7 [$ p+ u7 U6 T0 R! P*** Configuring hosts
9 {# v2 k4 p5 v4 h: t! g% Fh1 h2) T: |6 f+ r8 L9 T) x% q5 N8 F
*** Starting controller
$ x$ J l/ i" v! Y; f% _& f" K/ K*** Starting 1 switches
( d# N" j6 ~8 K n" us1& q Q; F) W2 V( q I
*** Waiting for switches to connect
1 R1 X6 W5 S: C- Cs1
+ Y/ u$ U# K) t3 h7 q, e*** Ping: testing ping reachability
) c& S. F1 I8 g7 G" t/ e) xh1 -> h21 n" z# p; R, S3 d/ K& E
h2 -> h1
+ n* o* H* q( \4 t8 I* N- T*** Results: 0% dropped (2/2 received)) O. }& w. a$ i9 s; Y" t- @4 T+ m# a
*** Stopping 1 controllers
+ P$ c' j3 _) W/ E" f+ e% uc0
+ H( S# Q, {" O0 d& N6 N Y*** Stopping 1 switches
% Y8 z" {; Y4 ?2 b% z' us1 ..* L+ ?5 `/ ^0 ~
*** Stopping 2 hosts5 u5 F9 K# h4 W
h1 h2
. U( ]9 T9 u9 G4 s" A+ {*** Done
! n. o" _0 o- V' E6 }completed in 5.397 seconds
! n5 I' _2 i" x. H8 k, Y% v) zSo it seems to work. But there are a few things to note.. _; T. G8 K+ k! D; V8 u! t' E: V
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.
* C m8 w& T! I, H& I6 j# ?: z2. The above is the extent of the testing I did. There may be other issues that crop up.
- `& d' `7 _5 t% Y3 bHope this helps anyone that uses CentOS or RHEL 7 with Mininet.
1 q& j# u# a# C. W6 n0 j- p
- }; {3 U3 T. Q$ }This post ‘Mininet and OVS on CentOS 7’ first appeared on https://techandtrains.com/. |
|