6to4隧道
6to4隧道
6rd隧道測試:https://blog.csdn.net/zdl244/article/details/103280256
6to4隧道定義了一個網絡前綴2002::/16用于表達這是一個6to4網絡整體,
地址格式2002:a.b.c.d:xxxx:xxxx:xxxx:xxxx:xxxx,(a.b.c.d是IPv4地址)
???????任何一個公共IPv4地址將地址的十六進制值加在6to4網絡前綴之后,從而產生一個前綴數為48的相應IPv4的6to4子網的網絡前綴,而且其仍然可以繼續分割至最小前綴數為64的子網段用于區分出這個6to4子網的子網。
測試環境
使用兩臺Centos主機ipv4地址是192.168.1.107和192.168.2.108充當路由器,實現6to4隧道,前綴是2002::/16
拓撲圖:
主機A(192.168.1.107)--------路由器---------主機B(192.168.2.108)
192.168.1.107配置:
[root@RA ~]# ip tunnel add 6to4 mode sit remote any local 192.168.1.107 [root@RA ~]# ip -6 addr add 2002:c0a8:016b:2019::1/64 dev 6to4 #配置隧道接口地址,192.168.1.107轉換成16進制是"c0a8:016b" [root@RA ~]# ip link set 6to4 up [root@RA ~]# route -6 add 2002:c0a8:026c::/48 dev 6to4 #將對端2002:c0a8:026c::/48的路由指向隧道接口192.168.2.108配置:
[root@RB ~]# ip tunnel add 6to4 mode sit remote any local 192.168.2.108 [root@RB ~]# ip -6 addr add 2002:c0a8:026c:2019::1/64 dev 6to4 [root@RB ~]# ip link set 6to4 up [root@RB ~]# route -6 add 2002:c0a8:016b::/48 dev 6to4在主機A測試ping6主機B可達。
[root@RA ~]# ping6 2002:c0a8:026c:2019::1 PING 2002:c0a8:026c:2019::1(2002:c0a8:26c:2019::1) 56 data bytes 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=1 ttl=64 time=0.551 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=2 ttl=64 time=0.669 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=3 ttl=64 time=0.563 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=4 ttl=64 time=0.590 ms ^C --- 2002:c0a8:026c:2019::1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3000ms rtt min/avg/max/mdev = 0.551/0.593/0.669/0.049 ms增加lo接口地址測試:
[root@RA ~]# ip -6 addr add 2002:c0a8:016b:2018::1/64 dev lo [root@RA ~]# ping6 -I 2002:c0a8:016b:2018::1 2002:c0a8:026c:2019::1 PING 2002:c0a8:026c:2019::1(2002:c0a8:26c:2019::1) from 2002:c0a8:16b:2018::1 : 56 data bytes 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=1 ttl=64 time=0.644 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=2 ttl=64 time=0.600 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=3 ttl=64 time=0.638 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=4 ttl=64 time=0.560 ms ^C --- 2002:c0a8:026c:2019::1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3002ms rtt min/avg/max/mdev = 0.560/0.610/0.644/0.041 ms總結
- 上一篇: windows10应用商店下安装kali
- 下一篇: 视觉在无人驾驶中的应用及分类_机器视觉在