如何在Mininet中修改host的IP地址

如何在Mininet中修改host的IP地址,第1张

I got it! do like this:

mininet>py h1.setIP('10.0.0.3/24')

mininet>py h2.setIP('10.0.0.4/24')

mininet>h1 ping h2

PING 10.0.0.4(10.0.0.4)56(84) bytes of data.

64 bytes from10.0.0.4: icmp_req=1 ttl=64 time=2.38 ms

On Sunday, March 30, 2014 2:15:13 AM UTC+8, Yong Wang wrote:

Hi everyone,

When I change host's IP, other hosts cannot ping through it, but it can ping other host.

And I find that, when typing in dump command, it shows that the IP is not changed.

That's why? How can I really change the ip of virtual host?

mininet>h1 ifconfig h1-eth0 10.0.1.1

mininet>h1 ifconfig

h1-eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:01

inet addr:10.0.1.1 Bcast:10.255.255.255 Mask:255.0.0.0

inet6 addr: fe80::200:ff:fe00:1/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:1543 errors:0 dropped:1302 overruns:0 frame:0

TX packets:185 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:101016 (101.0 KB) TX bytes:13746 (13.7 KB)

loLink encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:3 errors:0 dropped:0 overruns:0 frame:0

TX packets:3 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:336 (336.0 B) TX bytes:336 (336.0 B)

mininet>dump

<RemoteController c0: 192.168.56.1:6633 pid=1891>

<OVSSwitch s3: lo:127.0.0.1,s3-eth1:None,s3-eth2:None,s3-eth3:None,s3-eth4:None pid=1904>

<Host h1: h1-eth0:10.0.0.1 pid=1898>

<Host h2: h2-eth0:10.0.0.2 pid=1899>

<Host h3: h3-eth0:10.0.0.3 pid=1900>

<Host h4: h4-eth0:10.0.0.4 pid=1901>

mininet>h1 ping h2

PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.

64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=5.33 ms

64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.253 ms

64 bytes from 10.0.0.2: icmp_req=3 ttl=64 time=0.070 ms

^C

--- 10.0.0.2 ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2000ms

rtt min/avg/max/mdev = 0.070/1.887/5.339/2.442 ms

mininet>h2 ping h1

PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.

From 10.0.0.2 icmp_seq=1 Destination Host Unreachable

From 10.0.0.2 icmp_seq=2 Destination Host Unreachable

From 10.0.0.2 icmp_seq=3 Destination Host Unreachable

^C

--- 10.0.0.1 ping statistics ---

4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3015ms

pipe 3

mininet>

Thank you in advance for any answers.

在windows7 中安装xshell 和 xmanager4

在xshell中创建新会话(IP地址输入第1步中输入虚拟机中mininet VM的IP地址),选择“转发X11连接(X)”如下图

转发X11连接(X)

其它按照常规设置即可。

3.测试

使用xshell登录虚拟机后输入xterm,xshell即可自动启动xmanager并将xterm显示在windows7下。

启动wireshark:

# wireshark &

即可看到wireshark的图形界面.


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/7880811.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-11
下一篇 2023-04-11

发表评论

登录后才能评论

评论列表(0条)

保存