实验需求
1、两个局域网基于6to4tunnel可达
2、R1可以访问R3的环回
实验拓扑
实验分析
1、先配置中心ipv4环境
2、然后配置左边ipv4环境,r1要访问中心公网需要在r2上做nat
3、使用ripng配置左边ipv6环境
4、用6to4 tunnel连接到右边的ipv6环境
5、使用bgp和ospf配置右边的ipv6环境
6、用6to4 tunnel连接到左边的ipv4环境
实验配置
1. 配置ipv4环境
1.1 配置R1-R4的ipv4 ip
1.2 r2-r4启用ospf
r2
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 23.1.1.1 0.0.0.0
r3
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 23.1.1.2 0.0.0.0
network 34.1.1.1 0.0.0.0
r4
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 34.1.1.2 0.0.0.0
1.3 r1写缺省指向ipv4公网
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
1.4 r2上配置nat
acl number 2000
rule 5 permit source 1.1.1.0 0.0.0.255
rule 10 permit source 12.1.1.0 0.0.0.255
在接口g0/0/1上调用nat
[r2-GigabitEthernet0/0/1] nat outbound 2000
2. 配置左边ipv6环境
2.1 配置左边ipv6 ip
R1
R2
2.2 左边ipv6环境配置ripng
r1
[r1]ripng 1
[r1-ripng-1]int g0/0/0
[r1-GigabitEthernet0/0/0] ripng 1 enable
r2
[r2]ripng 1
[r2-ripng-1]int g0/0/0
[r2-GigabitEthernet0/0/0] ripng 1 enable
2.3 r1上写缺省路由指向r2
2.4 r2上配置6to4 tunnel
[r2]int t0/0/0
[r2-Tunnel0/0/0]dis th
[V200R003C00]
#
interface Tunnel0/0/0
ipv6 enable
ipv6 address 2002:1701:101::1/64
tunnel-protocol ipv6-ipv4 6to4
source 23.1.1.1
#
return
3. 配置右边ipv6环境
3.1 配置r4-r8的ip(ipv6)
3.2 r5-r8启用ospfv3
[r5]ospfv3 1
[r5-ospfv3-1]router-id 5.5.5.5
[r5-ospfv3-1]int lo0
[r5-LoopBack0]ospfv3 1 area 0.0.0.0
[r6]ospfv3 1
[r6-ospfv3-1]router-id 6.6.6.6
[r6-ospfv3-1]int lo0
[r6-LoopBack0]ospfv3 1 area 0.0.0.0
[r7]ospfv3 1
[r7-ospfv3-1]router-id 7.7.7.7
[r7-ospfv3-1]int lo0
[r7-LoopBack0]ospfv3 1 area 0.0.0.0
[r8]ospfv3 1
[r8-ospfv3-1]router-id 8.8.8.8
[r8-ospfv3-1]int lo0
[r8-LoopBack0]ospfv3 1 area 0.0.0.0
3.3 r4-r8启动p,r4属于as1,r5-r7的私有as号为64512,公有as号为2,r8的私有as号为64513,公有as号为2
r4
bgp 1
router-id 4.4.4.4
peer 2002:2201:102:45::2 as-number 2
#
ipv4-family unicast
undo synchronization
#
ipv6-family unicast
undo synchronization
network 2002:: 16
network 2002:2201:102:4:: 64
peer 2002:2201:102:45::2 enable
#
return
r5
bgp 64512
router-id 5.5.5.5
confederation id 2
peer 2002:2201:102:6::1 as-number 64512
peer 2002:2201:102:6::1 connect-interface LoopBack0
peer 2002:2201:102:45::1 as-number 1
#
ipv4-family unicast
undo synchronization
#
ipv6-family unicast
undo synchronization
network 2002:2201:102:5:: 64
peer 2002:2201:102:6::1 enable
peer 2002:2201:102:6::1 next-hop-local
peer 2002:2201:102:45::1 enable
r6
[r6]bgp 64512
[r6-bgp]dis th
[V200R003C00]
#
bgp 64512
router-id 6.6.6.6
confederation id 2
peer 2002:2201:102:5::1 as-number 64512
peer 2002:2201:102:5::1 connect-interface LoopBack0
peer 2002:2201:102:7::1 as-number 64512
peer 2002:2201:102:7::1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
#
ipv6-family unicast
undo synchronization
network 2002:2201:102:6:: 64
peer 2002:2201:102:5::1 enable
peer 2002:2201:102:5::1 reflect-client
peer 2002:2201:102:7::1 enable
peer 2002:2201:102:7::1 reflect-client
#
return
r7
bgp 64512
router-id 7.7.7.7
confederation id 2
confederation peer-as 64513
peer 2002:2201:102:6::1 as-number 64512
peer 2002:2201:102:6::1 connect-interface LoopBack0
peer 2002:2201:102:8::1 as-number 64513
peer 2002:2201:102:8::1 ebgp-max-hop 2
peer 2002:2201:102:8::1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
#
ipv6-family unicast
undo synchronization
network 2002:2201:102:7:: 64
peer 2002:2201:102:6::1 enable
peer 2002:2201:102:8::1 enable
#
return
r8
bgp 64513
router-id 8.8.8.8
confederation id 2
confederation peer-as 64512
peer 2002:2201:102:7::1 as-number 64512
peer 2002:2201:102:7::1 ebgp-max-hop 2
peer 2002:2201:102:7::1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
#
ipv6-family unicast
undo synchronization
network 2002:2201:102:8:: 64
peer 2002:2201:102:7::1 enable
#
return
3.4 r4上配置6to4 tunnel
#
interface Tunnel0/0/0
ipv6 enable
ipv6 address 2002:2201:102::1/64
tunnel-protocol ipv6-ipv4 6to4
source 34.1.1.2
#
return
验证
ipv4私网访问公网
左边局域网访问右边局域网
game over