题目分析:
左边是双栈内网,右边是纯V6内网,中间是V4公网,通过6to4把两边V6打通
R1可以访问到3的环回(公网部分)
拓扑图
一、配置IP v4环境,先公网后私网
2/3/4搭建
[R2]ipv6
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 23.1.1.1 24
[R1]ip route-static 0.0.0.0 0 192.168.0.2
[R2]ip route-static 192.168.1.0 24 192.168.0.1
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 23.1.1.2 24
[R3-GigabitEthernet0/0/1]int lo0
[R3-LoopBack0]ip address 3.3.3.3 24
[R3-LoopBack0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 34.1.1.1 24
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 34.1.1.2 24
[R2]ip route-static 0.0.0.0 0 23.1.1.2
[R4]ip route-static 0.0.0.0 0 34.1.1.1
1/2静态私网
[R1-LoopBack0]ip address 192.168.1.1 25
[R1-LoopBack1]ip address 192.168.1.129 25
[R1-GigabitEthernet0/0/1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.0.1 30
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.0.2 30
[R2-LoopBack0]ip address 192.168.2.1 24
[R1]ip route-static 0.0.0.0 0 192.168.0.2
[R2]ip route-static 192.168.1.0 24 192.168.0.1
R2上做nat
[R2]acl 2000
[R2-acl-basic-2000]ru
[R2-acl-basic-2000]rule pe
[R2-acl-basic-2000]rule permit s
[R2-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[R2-acl-basic-2000]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]nat o
[R2-GigabitEthernet0/0/0]nat outbound 2000
二、IPv6子网配置RIPNG
2002:1701:0101:0000::/64——2002:1701:0101:FFFF::/64
第一个网段再分成/65位配到环回
2002:1701:0101:0000:0000:/64的
2002:1701:0101:0000:0000::/65
2002:1701:0101:0000:8000::/65
[R1]ipv6
[R1-LoopBack0]ipv6 enable
[R1-LoopBack0]ipv6 address 2002:1701:0101:0000:0000::1/65
[R1-LoopBack0]int lo1
[R1-LoopBack1]ipv6 enable
[R1-LoopBack1]ipv6 address 2002:1701:0101:0000:8000::1/65
[R1-LoopBack1]int g0/0/0
[R1-GigabitEthernet0/0/0]ipv6 enable
[R1-GigabitEthernet0/0/0]ipv6 address 2002:1701:0101:0001::1/64
[R2]ipv6
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ipv6 enable
[R2-GigabitEthernet0/0/1]ipv6 address 2002:1701:0101:0001::2/64
[R2-GigabitEthernet0/0/1]int lo0
[R2-LoopBack0]ipv6 enable
[R2-LoopBack0]ipv6 address 2002:1701:0101:0002::1/64
先使用RIPNG让R1/2跑通
[R1]ripng 1
[R1-ripng-1]int lo0
[R1-LoopBack0]ripng 1 enable
[R1-LoopBack0]int lo1
[R1-LoopBack1]ripng 1 enable
[R1-LoopBack1]int g0/0/0
[R1-GigabitEthernet0/0/0]ripng 1 enable
[R2]ripng 1
[R2-ripng-1]int lo0
[R2-LoopBack0]ripng 1 enable
[R2-LoopBack0]int g0/0/1
[R2-GigabitEthernet0/0/1]ripng 1 enable
汇总
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]int g0/0/0
[R1-GigabitEthernet0/0/0]ripng summary-address 2002:1701:0101:0000:: 64
[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ipv6 enable
[R2-Tunnel0/0/0]ipv6 address 2002:1701:0101:0003::1/64
[R2-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4
[R2-Tunnel0/0/0]source g0/0/0
[R2]ipv6 route-static 2002:: 16 Tunnel 0/0/0
[R2-GigabitEthernet0/0/1]ripng default-route only
三、IPv6子网2
2002:2201:0102::/49 AS1——2002:2201:0102::/64——2002:2201:0102:7FFF::/64
2002:2201:0102:8000::/49 (R4/5之间给到AS1)
[R4]ipv6
[R4-GigabitEthernet0/0/0]int lo0
[R4-LoopBack0]ipv6 enable
[R4-LoopBack0]ipv6 address 2002:2201:0102::1/64
[R4-LoopBack0]int g0/0/0
[R4-GigabitEthernet0/0/0]ipv6 enable
[R4-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:001::1/64
[R5]ipv6
[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]ipv6 enable
[R5-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:001::2/64
[R5-GigabitEthernet0/0/1]int lo0
[R5-LoopBack0]ipv6 enable
[R5-LoopBack0]ipv6 address 2002:2201:0102:8000::1/64
[R5-LoopBack0]int g0/0/0
[R5-GigabitEthernet0/0/0]ipv6 enable
[R5-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:8001::1/64
[R6]ipv6
[R6]int g0/0/1
[R6-GigabitEthernet0/0/1]ipv6 enable
[R6-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8001::2/64
[R6-GigabitEthernet0/0/1]int lo0
[R6-LoopBack0]ipv6 address 2002:2201:0102:8002::1/64
[R6-LoopBack0]int g0/0/0
[R6-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:8003::1/64
[R7-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8003::2/64
[R7-LoopBack0]ipv6 address 2002:2201:0102:8004::1/64
[R7-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:8005::1/64
[R8-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8005::2/64
[R8-LoopBack0]ipv6 address 2002:2201:0102:8006::1/64
配好以后先起IGP——跑OSPFV3
[R5]ospfv3 1
[R5-ospfv3-1]router-id 5.5.5.5
[R5-ospfv3-1]int lo0
[R5-LoopBack0]ospfv3 1 area 0
[R5-LoopBack0]int g0/0/0
[R5-GigabitEthernet0/0/0]ospfv3 1 area 0
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ospfv3 1 area 0
[R6]ospfv3 1
[R6-ospfv3-1]router-id 6.6.6.6
[R6-ospfv3-1]int lo0
[R6-LoopBack0]ospfv3 1 area 0
[R6-LoopBack0]int g0/0/0
[R6-GigabitEthernet0/0/0]ospfv3 1 area 0
[R6-GigabitEthernet0/0/0]int g0/0/1
[R6-GigabitEthernet0/0/1]ospfv3 1 area 0
[R6-GigabitEthernet0/0/1]
[R7]ospfv3 1
[R7-ospfv3-1]router-id 7.7.7.7
[R7-ospfv3-1]int g0/0/0
[R7-GigabitEthernet0/0/0]ospfv3 1 area 0
[R7-GigabitEthernet0/0/0]int lo0
[R7-LoopBack0]ospfv3 1 area 0
[R7-LoopBack0]int g0/0/1
[R7-GigabitEthernet0/0/1]ospfv3 1 area 0
[R8]ospfv3 1
[R8-ospfv3-1]router-id 8.8.8.8
[R8-ospfv3-1]int lo0
[R8-LoopBack0]ospfv3 1 area 0
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ospfv3 1 area 0
起BGP
display ipv6 interface brief
[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]router-id 5.5.5.5
[R5-bgp]confederation id 2
[R5-bgp]peer 2002:2201:102:1::1 as-number 1
[R5-bgp]ipv6-family
[R5-bgp-af-ipv6]peer 2002:2201:102:1::1 enable
后期用环回建邻容易把自己搞晕,引入多数组概念
[R8-LoopBack0]ipv6 address 8::8/64
[R7-LoopBack0]ipv6 address 7::7/64
[R6-LoopBack0]ipv6 address 6::6/64
[R5-LoopBack0]ipv6 address 5::5/64
不用宣告,本身就跑OSPF
[R5-bgp]peer 6::6 as-number 64512
[R5-bgp]peer 6::6 connect-interface lo0
[R5-bgp]ipv6-family
[R5-bgp-af-ipv6]peer 6::6 enable
[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 lo0
[R6-bgp]ipv6-family
[R6-bgp-af-ipv6]pe
[R6-bgp-af-ipv6]peer 5::5 enable
[R6-bgp]peer 5::5 connect-interface lo0 6::6
[R5-bgp]peer 6::6 connect-interface lo0 5::5
[R6-bgp]peer 7::7 as-number 64512
[R6-bgp]peer 7::7 connect-interface lo0 6::6
[R6-bgp]ipv6-family
[R6-bgp-af-ipv6]peer 7::7 enable
[R7]bgp 64512
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 2
[R7-bgp]confederation peer-as 64513
[R7-bgp]peer 6::6 as-number 64512
[R7-bgp]peer 6::6 connect-interface lo0 7::7
[R7-bgp]peer 8::8 as-number 64513
[R7-bgp]peer 8::8 connect-interface lo0 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 enable
[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 lo0 8::8
[R8-bgp]peer 7::7 ebgp-max-hop 2
[R8-bgp]ipv6-family
[R8-bgp-af-ipv6]peer 7::7 en
R5/6/7/8学去往外边路由,而R4要学去往右边和却往左边的路由
4要出去就要打tunnel
[R4]int t0/0/0
[R4-Tunnel0/0/0]ipv6 enable
[R4-Tunnel0/0/0]ipv6 address 2002:2201:0102:2::1/64
[R4-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4
[R4-Tunnel0/0/0]source g0/0/1
[R4]ipv6 route-static 2002:: 16 Tunnel 0/0/0
[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
IGP内部到外网的路由
[R4]bgp 1
[R4-bgp]ipv6-family
[R4-bgp-af-ipv6]network 2002:: 16
[R5]bgp 64512
[R5-bgp]ipv6-family
[R5-bgp-af-ipv6]peer 6::6 next-hop-local
[R6]bgp 64512
[R6-bgp]ipv6-family
[R6-bgp-af-ipv6]peer 7::7 reflect-client