首先在1 2 3 4上搭建ipv4网络
配好IP后,r2,r4使用缺省指向r3
r2配置nat
[Huawei]acl 2000
[Huawei-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[Huawei-acl-basic-2000]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]nat outbound 2000
使r1使用ipv4可以访问公网
计算ipv6地址:
23.1.1.1
2002:1701:0101::/48
2002:1701:0101:ffff::/64
类似如下
使用ripng创建tunnel,配置路由
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ipv6 enable
[r2-Tunnel0/0/0]ipv6 add 2002:1701:0101:0003::1/64
[r2-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4
[r2-Tunnel0/0/0]source 23.1.1.1
[r2-Tunnel0/0/0]q
[r2]ipv6 route-static 2002:: 16 Tunnel 0/0/0
[r2]ripng 1
[r2-ripng-1]int g0/0/0
[r2-GigabitEthernet0/0/0]ripng default-route only
右侧IP地址规划
34.1.1.2
2002:2201:0102::/48
2002:2201:0102::/49 as1
2002:2201:0102:8000::/49 as2
类似如下
使用ospfv3先建立邻居如下
r4,r5之间BGP建邻
[r4]bgp 1
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 2002:2201:102:1::2 as-number 2
[r4-bgp]ipv6-family
[r4-bgp-af-ipv6]peer 2002:2201:102:1::2 enable
[r5]bgp 64512
[r5-bgp]confederation id 2
[r5-bgp]router-id 5.5.5.5
[r5-bgp]peer 2002:2201:102:1::1 as-number 1
[r5-bgp-af-ipv6]peer 2002:2201:102:1::1 en
可以使用环回配ipv6地址来建邻
使用环回建邻
[r6]bgp 64512
[r6-bgp]router-id 6.6.6.6
[r6-bgp]confederation id 2
[r6-bgp]peer 5::5 as-number 64512
[r6-bgp]peer 5::5 connect-interface LoopBack 0 6::6
[r6-bgp]peer 7::7 as-number 64512
[r6-bgp]peer 7::7 connect-interface lo 0 6::6
[r6-bgp]ipv6-family
[r6-bgp-af-ipv6]peer 5::5 en
[r6-bgp-af-ipv6]peer 7::7 en
[r7]bgp 64512.
[r7-bgp]confederation id 2
[r7-bgp]confederation peer-as 64513
[r7-bgp]router-id 7.7.7.7
[r7-bgp]peer 6::6 as-number 64512
[r7-bgp]peer 6::6 connect-interface lo 0 7::7
[r7-bgp]peer 8::8 as-number 64513
[r7-bgp]peer 8::8 connect-interface lo 0 7::7
[r7-bgp]peer 8::8 ebgp-max-hop 2
[r7-bgp]ipv6-family
[r7-bgp-af-ipv6]peer 6::6 en
[r7-bgp-af-ipv6]peer 8::8 en
[r8]bgp 64513
[r8-bgp]router-id 8.8.8.8
[r8-bgp]confederation id 2
[r8-bgp]confederation peer-as 64512
[r8-bgp]peer 7::7 as-number 64512
[r8-bgp]peer 7::7 connect-interface lo 0 8::8
[r8-bgp]peer 7::7 ebgp-max-hop 2
[r8-bgp]ipv6-family
[r8-bgp-af-ipv6]peer 7::7 en
配置路由
[r4]bgp 1
[r4-bgp]ipv6-family
[r4-bgp-af-ipv6]net 2002:: 16
[r5]ipv6 route-static 2002:2201:0102:8000:: 49 NULL 0
[r5]bgp 64512
[r5-bgp]ipv6-family
[r5-bgp-af-ipv6]network 2002:2201:0102:8000:: 49
[r5-bgp-af-ipv6]peer 6::6 next-hop-local
r6配置反射器
[r6]bgp 64512
[r6-bgp]ipv6-family
[r6-bgp-af-ipv6]peer 7::7 reflect-client
测试
r8 ping r1环回