Unable to Use ping6 in mininet

淺唱寂寞╮ 提交于 2020-05-15 17:16:06

问题


I am running a Python script on mininet (virtual machine), which looks like this:

def main():
    setLogLevel('info')
    net = Mininet(switch=LinuxBridge, controller=None)
    h1 = net.addHost('h1', ip=None)
    h2 = net.addHost('h2', ip=None)
    s0 = net.addSwitch('s0')
    s1 = net.addSwitch('s1')
    s2 = net.addSwitch('s2')
    r1 = net.addHost('r1', ip=None)
    r1.cmd('sysctl -w net.ipv6.conf.all.forwarding=1')
    r2 = net.addHost('r2', ip=None)
    r2.cmd('sysctl -w net.ipv6.conf.all.forwarding=1')

    net.addLink(h1, s1)
    net.addLink(r1, s1)
    net.addLink(r1, s0)
    net.addLink(r2, s0)
    net.addLink(r2, s2)
    net.addLink(h2, s2)

    h1.cmd("ip -6 addr add 2001:638:709:a::1/64 dev h1-eth0")
    h2.cmd("ip -6 addr add 2001:638:709:b::1/64 dev h2-eth0")
    r1.cmd("ip -6 addr add 2001:638:709:a::f/64 dev r1-eth0")
    r1.cmd("ip -6 addr add 2001:638:709:f::1/64 dev r1-eth1")
    r2.cmd("ip -6 addr add 2001:638:709:f::2/64 dev r2-eth0")
    r2.cmd("ip -6 addr add 2001:638:709:b::f/64 dev r2-eth1")

    h1.cmd("ip -6 route add 2001:638:709::/48 via 2001:638:709:a::f dev h1-eth0")
    r1.cmd("ip -6 route add 2001:638:709:b::/64 via 2001:638:709:f::2 dev r1-eth1")
    r2.cmd("ip -6 route add 2001:638:709:a::/64 via 2001:638:709:f::1 dev r2-eth0")
    h2.cmd("ip -6 route add 2001:638:709::/48 via 2001:638:709:b::f dev h2-eth0")

    net.start()
    CLI(net)
    net.stop()

After running it, when I do h1 ping6 2001:638:709:b::1 I get an error that

Address family not supported by protocol

if i try h1 ping6 2001:638:709:b::f/64, I get unknown host.

What is the correct method to verify the networks?

来源:https://stackoverflow.com/questions/60874596/unable-to-use-ping6-in-mininet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!