- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
December 3, 2014
9 g5 B1 I$ ~. TMost 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.! J# t0 N& U% W
$ t. W6 W0 l) P. I6 x
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./ b8 Q& T; x' j4 t* x1 F$ v
" D9 [( M, K4 `* E$ | [0 eThis 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.
- o) ~& \5 p0 X0 k# Q1 ?
. q- ~' O- q- h+ q" {* f" C
/ k4 [; V3 @( H( M4 g. PDo not install Mininet on your host computer
; s8 h% ?1 F5 i& @% n& x+ Z" @Warning: Do not install Mininet on your host computer. Install in in a virtual machine.
, E9 T4 A, D8 X" Y$ U( U0 G' v7 L! W5 p" b+ x- O! o/ i( }
The 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.8 y: I2 F* A9 S( u/ _* A4 s* a
& P& c) z/ F/ ^% j' D/ r" N
In 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.
; I. m8 k- c! `' J+ ~2 r k2 m0 ?8 X& K" L- m3 t' @0 Y
Unless you are a Linux expert, ensure that you install Mininet only on a VM.+ F( h4 d3 x( r6 U: z
- z+ t3 V- ^5 z4 ~' dInstallation Procedure/ N8 V" z- e- L$ P$ S
The 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., ~ g( B8 ?1 Y5 g& L
: b* N' e6 G x6 _' }* d( q1 YTo install Mininet 2.2 Beta on a new virtual machine, we will execute the following steps:4 d& x& C2 r, {9 r' k* ]# n' M1 q
. `, W( m! p. D6 g
Install Ubuntu Server 14.04 on a new VirtualBox virtual machine image
6 d; b6 M, F7 K/ P6 RUpdate the Ubuntu Server system and install required software
. I: E5 ^. g- g: u/ q( P sInstall Mininet 2.2 on the Ubuntu Server virtual machine1 y8 e4 y0 e ^# q7 }
Set up the virtual machine to work with the host computer
2 E$ u; b6 |, A0 [# m4 G0 _4 f1 n: PLogin to the Ubuntu Server VM and enable X11 forwarding using SSH
! z, l# k% q8 J6 j8 d& iInstall Ubuntu Server on a VM
/ _8 u( A; @& [/ q7 P0 N7 H: I W5 K- U1 [
Download the Ubuntu Server 14.04 ISO image from ubuntu.com.4 q' j$ ]& `# Q5 o) }
|. z- p7 n6 P" x. R# eCreate 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.! ~" k9 f& g8 m0 O m% q5 l
+ F6 d% q% M2 E/ p" }4 c- OWhen 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).
- E+ z6 [% A0 ^
1 t0 D( z7 m- {6 pIn 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.
9 T% w( f8 [& ~8 h& G) V" C( N1 i+ f5 m: m5 N
Update the Ubuntu Server VM& s# e* x$ |& {" [) I' ]1 W l5 |
" {. |; E( f( _2 NFirst download and install system updates.
7 {6 {' a, o; R6 q; @. X/ K% C) G7 U ^. q3 q- c) R
$ sudo apt-get update
R0 {( J: l9 E* _ R+ f+ x# u$ sudo apt-get upgrade
4 r: b9 {3 o! b# ?8 T3 W' Y2 Z$ sudo apt-get dist-upgrade
/ t+ l' a _6 d9 W) DInstall required software
! D3 }3 |& @# L) D& Y! k8 N; {7 R' H* t
Install git. Git is the software version control system used by the Mininet project.$ |2 C. Y! E6 s/ A) c! U9 j
+ S+ X8 e. v4 B
$ sudo apt-get install git
5 w0 C1 n6 S& w7 @/ PInstall Mininet 2.2 from source code
- ?; L6 w' H; H
1 Q) B+ G" ^5 l4 C$ d5 q" uUse git to download the Mininet 2.2.0 source code.
" S3 c, G( |. f; n6 H0 ~) C; D* D. V4 g: e% l2 Q( S9 F/ |( X8 M- ?
$ git clone git://github.com/mininet/mininet) ^5 }8 X4 t3 p
This creates a folder in the home directory named mininet that contains the project file structure.9 I6 J1 H, O( b' o# \- C
8 v5 E+ z# ^: [5 E: ^; m. ~To find the latest beta version of Mininet, list all tagged releases in the Mininet project.- q! ?$ M/ @( `5 ^
# `: z# b4 E% H$ z0 x% u
$ cd mininet
- s& n$ h# g$ C1 b0 }9 _$ git tag$ Q+ T2 U3 k: ~
1.0.0
) m1 F' y! c# C: \# {( X9 K/ B2.0.0
5 k5 z! o: v) ^! A7 ]" k: ?. i* s, r2.1.0 \) @/ Z5 q! ^! y* @. B
2.1.0p1
" K$ f' E8 V5 A$ R6 \3 M J2.1.0p2
& m6 p2 `5 M$ W8 R2.2.0b0# [/ F* q, h6 X7 h% X
2.2.0b19 |0 i1 Q9 E! u" {+ x1 k- V, T+ V
2.2.0b2
. l% P3 X, m. ], c6 D2.2.0b3
# J& q0 [3 L. t. ], Vcs244-spring-2012-final
: F/ k ^6 t! `( X, x8 _Above, we see the latest available beta release is 2.2.0b3. So, we switch to that branch on our virtual machine.
6 @+ k3 d9 l5 G& ]$ K
5 P% n% P6 r9 K' W$ git checkout -b 2.2.0b3
+ O; F! W$ N" b8 j1 wSwitched to a new branch '2.2.0b3'. ~: @9 x$ l" ~5 O8 S
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 `9 _/ B7 r) i+ J) j- o, L& S4 N; ^" w* r! m% ^! J' C
$ ~/mininet/util/install.sh -a5 g( @! P& s" w! f8 R' ]
After 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.
/ J' Y7 Q9 d) }+ h# t* S8 N
( O% n% h2 K( b0 J, K5 U! A$ sudo mn --test pingall" p9 X9 e% Y- o! y0 `& x5 M
Set up the VM to work with the host computer
& c. } a4 N& i$ [& ^$ d q/ ?) B- x9 B6 C% z
Now we will set up the virtual machine so that we can connect to it from the host computer using SSH.$ p$ O" n# b1 d6 r9 ~5 g, Y# z, @7 h
$ I) e. a3 E6 ?% Y; w y
Shut down the Ubuntu Server VM.6 Z$ T- k5 L6 o- p1 u
: Y$ q* `7 p- a9 B5 D0 ?# |
$ sudo shutdown -h now& |) }# ]$ M+ E4 \# K/ `$ Y& L2 l* U
In VirtualBox, Add a host-only adapter to the VM. Use the procedures listed below in my post about setting up the Mininet VM.
* N: E5 H; M( S
. r* [0 Z0 J. v! b& hAdd a Host-only Adapter in VirtualBox
) R5 h3 L6 L/ KAdd Network Adapter to Mininet virtual machine
0 o* C! x9 U3 {% e+ jStart the Ubuntu Server VM again and log in via the VirtualBox console window
( l3 d4 y& y! A/ J3 PConfigure a new virtual ethernet interface on the virtual machine6 B4 Y& R- m6 b/ J8 n) u
In the VirtualBox console menu, login to the VM and make a note of the IP address used by the host-only adapter:5 h, E7 b7 e" ]
- O( j. v3 W# w: `
$ ifconfig eth1( W4 r; I5 T3 Q9 ~4 [! k
You may log out of the VirtualBox console if you want.
0 n0 |0 D2 C7 E2 x% W! A8 C- ^2 ^0 K' z; ]3 v
Login to the Ubuntu Server VM7 }. h1 W% P- {6 ~" y9 ^
5 |' I; c) _# S9 R, I7 ^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.7 n2 L& Q- v, S) V$ x
2 f3 q A& H! ]# r, B1 ?( I2 ^% {
admin@Host:~$ ssh -Y brian@192.168.56.101
( @7 Y+ }6 j( u+ U6 d$ g6 fbrian@mininet-2-2:~$ & v/ R3 g" f5 Y/ P! y
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.% b. J6 _+ f/ ?
3 g; }3 r3 f' d0 t5 O
Conclusion4 W4 O8 W( n- v/ L6 S u9 H) F. b
We installed Mininet 2.2 Beta on a virtual machine running Ubuntu Server 14.04.7 V) }9 J- d) L$ Y% g. m
+ `/ b$ D) v# w: USee the README.md file in the ~/mininet directory after you download the Mininet source code |
|