- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
December 3, 2014- B. h4 ]/ s) V, m& w: a
Most people who use the Mininet network simulator will download and set up the Mininet virtual machine image. However, there are times when we may want to use a different version of Mininet than the one already installed in the Mininet VM.# h6 l6 i7 E3 D4 l. ?" [+ ^8 \
1 ]3 Z& t; B- N5 k
For example, we may want to use the newest features of Mininet currently being developed. The Mininet project releases beta-quality source code that user can download and install themselves.
. d( N* K1 H; D* d, z( X
1 g# {8 L9 I) f* d3 @4 }. tThis post will show how to install Mininet 2.2 Beta on a virtual machine image running Ubuntu Server. The steps described below should work for any version of Mininet that the user wants to install./ Z7 Y% R: P- V* \: J
. n A* O+ U5 E x) S! _; t3 }4 |/ b C7 j4 W! e
Do not install Mininet on your host computer* L' e$ n& @8 K) Z d/ I
Warning: Do not install Mininet on your host computer. Install in in a virtual machine.! Y+ p; X# M" Y* T* O, p
; n. q5 H( p* H+ W: W8 nThe Mininet install script may overwrite files in your home directory (depending on what you already have installed)1. If Mininet makes changes that cause problems on an existing virtual machine, you can just delete the VM and try again with a fresh Ubuntu Server image. But, if you install Mininet directly on your host computer you may cause problems.
0 k4 M! }1 P v
* `- R" d1 ~ M$ W* RIn my own experience, I tried installing Mininet on my host computer to see what would happen. After the installation was complete, I encountered system error messages and my current installation of Open vSwitch stopped working on my computer.
; }1 ?. T! `9 b9 b' A+ V5 x
# E1 {* m9 m# _! M, L* lUnless you are a Linux expert, ensure that you install Mininet only on a VM.( H, r+ \, A6 Q/ e4 J# a% ?
, |+ I( l* U! M0 U' G
Installation Procedure
2 ]6 \5 t; \( {0 P6 q" [1 jThe Mininet documentation provides installation instructions. In this post we describe the procedure we followed and add a few details we think are helpful. The Mininet documentation also provides information about how to uninstall Mininet, how to install Mininet in other Linux distributions, and other details that we do not cover in this post.
$ v" J$ H/ n6 _. C# @+ y) t% C
& N T5 j5 A5 H4 N' XTo install Mininet 2.2 Beta on a new virtual machine, we will execute the following steps:2 G+ \. K5 _3 D9 c+ C
9 p( v: T- g! {: e; y# m+ C( v
Install Ubuntu Server 14.04 on a new VirtualBox virtual machine image
* N- |. l+ l1 Q, s2 u9 C5 B. sUpdate the Ubuntu Server system and install required software& f' e6 d. g1 [- O8 H5 Q
Install Mininet 2.2 on the Ubuntu Server virtual machine
4 b: U+ Q ]. v% ^Set up the virtual machine to work with the host computer
, j/ A: l" A2 P4 B2 ^9 fLogin to the Ubuntu Server VM and enable X11 forwarding using SSH
# \8 e) i! N/ E1 rInstall Ubuntu Server on a VM
% K% E3 s, d9 e. K; f t) t% l9 N- z2 Z+ k6 b% e0 p8 T9 O1 T& }
Download the Ubuntu Server 14.04 ISO image from ubuntu.com.
4 a* ?4 c! ^ K9 E1 _! T$ d& l% g" R/ l
Create a new virtual machine in VirtualBox and install Ubuntu Server on it. Use the steps described in my previous post about installing Debian in a VirtualBox VM. The procedure is the same.# L% ~2 x0 n8 F. C4 k
+ I9 e/ Q5 {4 j3 X. k, N' c8 C
When installing Ubuntu Server, you can use all the default configurations and choose setting specific to your needs that will be obvious to you (like country, keyboard layout, and time zone)., q( h9 e& s6 T) N
2 X+ n9 P5 b" Q# gIn our example, I chose to name the server mininet-2-2 and to create a userid brian so all the following examples will use these names. You may choose different names.
1 W8 |: t2 Z: w7 q: X" y* s, B7 i+ [; {% R# p% T, t) ?# l
Update the Ubuntu Server VM+ q% I! m s; I3 J! H
) j' \3 N* W/ ]) n* a& HFirst download and install system updates.
% |: o! ]7 Y4 B* a9 E0 T1 Q% ]+ N1 X. }
$ sudo apt-get update9 r" N& S3 g6 H8 R4 t
$ sudo apt-get upgrade8 o, d% }. k( K& k: U7 u
$ sudo apt-get dist-upgrade9 X P6 C4 n# A. J/ [
Install required software
# c v( S2 ^; H9 c/ f
4 I' `( r4 q4 i$ z3 A& CInstall git. Git is the software version control system used by the Mininet project." F) i; w& `4 o4 R9 [' f, c9 _
* B1 X6 }2 w+ M3 s0 x! X. L$ sudo apt-get install git+ y$ A4 K7 @5 R
Install Mininet 2.2 from source code' E3 K0 g8 u5 Q1 X# C8 {7 _5 ?
+ x0 \+ A) I8 Y/ D0 Y* j, J# H9 m6 F
Use git to download the Mininet 2.2.0 source code./ u: l- M% W6 s2 i1 f( M7 l& A
3 k# W& Y$ q9 x+ P( Q) |1 B6 ~$ git clone git://github.com/mininet/mininet& O! r/ u* `& r8 z X% i! R
This creates a folder in the home directory named mininet that contains the project file structure.! K: s* V0 n# @$ P' x2 A8 z
% R' [$ s L6 X' m* nTo find the latest beta version of Mininet, list all tagged releases in the Mininet project.
- y7 i R6 T X$ W$ X! F1 C$ M1 X6 V6 `) w A
$ cd mininet
0 _& e) g8 y* d* [$ git tag9 k% Q4 x7 ^. b# h- J; Z$ s/ k# Y
1.0.01 p4 p$ N `2 r+ L) o
2.0.0; Z* i( t1 L2 I' `1 N2 I4 f
2.1.0
: w4 h( \" M! h2 S2.1.0p1
; T7 n6 u4 {2 V2.1.0p2
$ y; H9 Q, o2 H7 D& a! y2.2.0b03 O7 T* n9 `/ g
2.2.0b1
" t* V, ?# ]$ A7 f/ ]9 O2.2.0b2
* a- K5 ]+ E' n2.2.0b38 d0 W9 C6 A( U$ y
cs244-spring-2012-final
4 }7 \) W( }6 d8 A+ Q% [4 eAbove, we see the latest available beta release is 2.2.0b3. So, we switch to that branch on our virtual machine.3 N' x; V/ Q& j4 N8 U3 C
) V3 W6 C# f) T) D
$ git checkout -b 2.2.0b3
, f) N) X! E8 k' ^# }" RSwitched to a new branch '2.2.0b3'1 @ f0 V$ ^* x* |6 }! ]5 E7 y" A2 U
The Mininet project provides an install script. Run the script. This will install Mininet 2.2 because the script is run using the files in the Mininet 2.2.0b3 branch.6 z& y( a1 a1 B, h; o
* _% d5 x9 ]3 _; Z
$ ~/mininet/util/install.sh -a
+ p M9 N, e6 U! wAfter the script stops running, test that the installation was successful. Execute the following command to test the installation. It should run a short Mininet scenario successfully.1 `' h9 e2 I& P+ U. ]* f; P; v
- e, q0 ^) L. \/ D
$ sudo mn --test pingall
& P& U5 y; `' m1 s# F* C, ZSet up the VM to work with the host computer
2 d7 x5 Z0 M; s' y
5 V N4 w; g& [) |" y3 s$ MNow we will set up the virtual machine so that we can connect to it from the host computer using SSH.
4 e, V/ Q1 o( c+ y% D# p7 ~3 n. G" o+ }4 v5 J
Shut down the Ubuntu Server VM.1 o& k5 m. I& z& u1 D8 @7 k, P/ F7 x
! I* ]9 j6 @9 A8 j, I: N" m
$ sudo shutdown -h now
; P& N2 Y- }7 b9 W5 W* C$ m( aIn VirtualBox, Add a host-only adapter to the VM. Use the procedures listed below in my post about setting up the Mininet VM.
6 m, O& z# Q7 @- m2 Q4 s, v* O" m
2 n6 Z4 a" @8 g3 q% cAdd a Host-only Adapter in VirtualBox; I ^( K5 X3 {- ?# Q
Add Network Adapter to Mininet virtual machine1 S I( T% b S8 ^
Start the Ubuntu Server VM again and log in via the VirtualBox console window" M3 y* B: R# ]7 ^
Configure a new virtual ethernet interface on the virtual machine
; q# D" |5 m5 d5 Q: \$ kIn the VirtualBox console menu, login to the VM and make a note of the IP address used by the host-only adapter:
* W, z8 I7 n* o4 W: u. n7 I% @
: K/ F, G. h8 ?* M7 h4 e" b$ ifconfig eth1
! J9 p9 W" E* V5 x8 B; c5 f2 D GYou may log out of the VirtualBox console if you want. k5 j" {( S q
, Q* u" Q3 |1 `6 x4 R( V# J4 w# n
Login to the Ubuntu Server VM% _) U& {, ?8 R6 w! Q! Q
! G6 Z) }- g! M! L3 |
In our example above, the VM’s host-only adapter IP address is 192.168.56.101. So we will connect to this address via SSH from a terminal window on the host computer. This enables X11 forwarding so we can run X applications, such as Wireshark or MiniEdit.: ?; \9 ^0 L, V6 u! I
1 n6 X* e3 R4 Q5 W2 E
admin@Host:~$ ssh -Y brian@192.168.56.1017 S5 Z* k8 x0 x8 i! g
brian@mininet-2-2:~$ ' r$ }, M: p, V; D3 \
In the example above, we have a user account blinklet on the Ubuntu Server named mininet-2-2. You may have defined a different username and server name./ s: i. F4 g/ [) k( O( B, O
3 D# [- ]' m' l: d) H1 ]: b3 ]Conclusion
# u, o+ E5 z! H8 f1 R* E" B& LWe installed Mininet 2.2 Beta on a virtual machine running Ubuntu Server 14.04.9 a, f$ X- ^- g
, D( H* F( @- a
See the README.md file in the ~/mininet directory after you download the Mininet source code |
|