Mininet中文使用教程
RX packets:46716 errors:0 dropped:0 overruns:0 frame:0 TX packets:40265 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:10804203 (10.8 MB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 MTU:65536 Metric:1 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING RX packets:43654 errors:0 dropped:0 overruns:0 frame:0 TX packets:43654 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:37264504 (37.2 MB) lxcbr0 Link encap:Ethernet inet addr:10.0.3.1 TX bytes:37264504 (37.2 MB) TX bytes:40122199 (40.1 MB)
HWaddr fe:5e:f0:f7:a6:f3 Bcast:10.0.3.255 Mask:255.255.255.0 MTU:1500 Metric:1
inet6 addr: fe80::a8c4:b5ff:fea6:2809/64 Scope:Link UP BROADCAST RUNNING MULTICAST RX packets:52 errors:0 dropped:0 overruns:0 frame:0 TX packets:20 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4759 (4.7 KB) ovs-system Link encap:Ethernet TX bytes:2952 (2.9 KB)
HWaddr 3e:79:59:3d:d9:bb MTU:1500 Metric:1
BROADCAST MULTICAST
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) s1 Link encap:Ethernet TX bytes:0 (0.0 B) HWaddr 6e:8c:5d:91:d5:44 MTU:1500 Metric:1
inet6 addr: fe80::fc47:8aff:fe6a:4155/64 Scope:Link UP BROADCAST RUNNING RX packets:13 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1026 (1.0 KB) s1-eth1 Link encap:Ethernet TX bytes:648 (648.0 B)
HWaddr 5e:a2:f7:86:f3:b1 MTU:1500 Metric:1
inet6 addr: fe80::5ca2:f7ff:fe86:f3b1/64 Scope:Link UP BROADCAST RUNNING MULTICAST RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:22 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000
Mininet中文使用教程
RX bytes:648 (648.0 B) s1-eth2 Link encap:Ethernet
TX bytes:1764 (1.7 KB)
HWaddr b2:c6:37:e0:d9:61 MTU:1500 Metric:1
inet6 addr: fe80::b0c6:37ff:fee0:d961/64 Scope:Link UP BROADCAST RUNNING MULTICAST RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:21 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:648 (648.0 B) veth14524J Link encap:Ethernet TX bytes:1674 (1.6 KB)
HWaddr fe:ca:13:f5:dd:b4 MTU:1500 Metric:1
inet6 addr: fe80::fcca:13ff:fef5:ddb4/64 Scope:Link UP BROADCAST RUNNING MULTICAST RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:40 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:648 (648.0 B) veth2K19CE Link encap:Ethernet TX bytes:4190 (4.1 KB)
HWaddr fe:f1:f7:e8:49:45 MTU:1500 Metric:1
inet6 addr: fe80::fcf1:f7ff:fee8:4945/64 Scope:Link UP BROADCAST RUNNING MULTICAST RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:42 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:648 (648.0 B) veth9WSHRK Link encap:Ethernet TX bytes:4370 (4.3 KB) HWaddr fe:87:1d:33:f6:41 MTU:1500 Metric:1
inet6 addr: fe80::fc87:1dff:fe33:f641/64 Scope:Link UP BROADCAST RUNNING MULTICAST RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:43 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:648 (648.0 B) vethH2K7R5 Link encap:Ethernet TX bytes:4460 (4.4 KB) HWaddr fe:5e:f0:f7:a6:f3 MTU:1500 Metric:1
inet6 addr: fe80::fc5e:f0ff:fef7:a6f3/64 Scope:Link UP BROADCAST RUNNING MULTICAST RX packets:14 errors:0 dropped:0 overruns:0 frame:0 TX packets:48 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1776 (1.7 KB) vethO99MI2 Link encap:Ethernet TX bytes:5030 (5.0 KB) HWaddr fe:cf:ee:97:fb:7f
inet6 addr: fe80::fccf:eeff:fe97:fb7f/64 Scope:Link
Mininet中文使用教程
上面的输出中包含交换机的虚拟网卡 s1,以及主机的 eth0。
为了区别显示host 主机的网络是隔离的,我们可以通过arp与route命令来做演示,分别在 s1与h1上面演示如下:
这样可以做到将每一个主机,交换机,以及控制器都放到他自己的标准的 network
namespace 中,但是这种做法并没有什么特别的优势,除非你想复制一个非常复杂的网络。Mininet 不支持这种做法,你可以通过--innamespace参数来查看更多的信息。
译者注:感觉有点像 LXC 或者说想最近比较火的 Docker
注意:只有网络是虚拟出来的,每一个主机里面的进程使用的都是同一套目录,可以看到相同的进程集合,我们打印不同主机下面的进程列表看看: