我在虚拟机上配置 6to4 时遇到问题。我有两台装有 ubuntu 的机器。
会议第一台机器:
#ip tunnel del tun6to4
#ip tunnel add tun6to4 mode sit ttl 64 remote any local 150.254.34.1
#ip link set dev tun6to4 up
#ip -6 addr add 2002:a02d:1701::1/16 dev tun6to4
会议第二台机器:
# ip tunnel del tun6to4
#ip tunnel add tun6to4 mode sit ttl 64 remote any local 160.45.23.1
#ip link set dev tun6to4 up
#ip -6 addr add 2002:96fe:2201:1/16 dev tun6to4
我尝试 ping 机器:在第一台机器上 ping 160.45.23.1,在第二台机器上 ping 150.254.34.1,结果无连接之间。
是什么原因?
答案1
这是我的地址:
第一台机器:
ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:86:4b:84 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.22/24 brd 192.168.100.255 scope global eth0
inet6 fe80::a00:27ff:fe86:4b84/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:00:3f:ba brd ff:ff:ff:ff:ff:ff
inet 192.168.100.20/24 brd 192.168.100.255 scope global eth1
inet6 fe80::a00:27ff:fe00:3fba/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:c0:93:ab brd ff:ff:ff:ff:ff:ff
inet6 fe80::a00:27ff:fec0:93ab/64 scope link
valid_lft forever preferred_lft forever
5: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
link/sit 0.0.0.0 brd 0.0.0.0
7: tun6to4: <NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN
link/sit 150.254.34.1 brd 0.0.0.0
inet6 2002:a02d:1701::1/16 scope global
valid_lft forever preferred_lft forever
inet6 ::150.254.34.1/128 scope global
valid_lft forever preferred_lft forever
第二台机器:
ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:bf:3f:29 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.26/24 brd 192.168.100.255 scope global eth0
inet6 fe80::a00:27ff:febf:3f29/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:75:71:01 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.27/24 brd 192.168.100.255 scope global eth1
inet6 fe80::a00:27ff:fe75:7101/64 scope link
valid_lft forever preferred_lft forever
4: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
link/sit 0.0.0.0 brd 0.0.0.0
5: tun6to4: <NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN
link/sit 160.45.23.1 brd 0.0.0.0
inet6 2002:96fe:2201::1/16 scope global
valid_lft forever preferred_lft forever
inet6 ::160.45.23.1/128 scope global
valid_lft forever preferred_lft forever