IPV6 6to4,BGP综合实验
IPV6 6to4,BGP综合实验

r1-r2区域

r1/2局域网访问公网
先将r1/2之间的私网跑通,基于192.168.1.0,r2/3/4公网跑通R2/3缺省指向r3,r1缺省指向r2,r2上配置两条静态通往r1

R2
acl 2000
rule permit source 192.168.0.0 0.0.255.255
int g0/0/1
nat outbound 2000
左接口ipv4算得ipv6
2002:1701:0101:0000::/64 - 2002:1701:0101:ffff::/64

配置

ipv6
int loo0
ipv6 enable
ipv6 add 2002:1701:0101:0000::1/64

int g0/0/0
ipv6 enable
ipv6 add 2002:1701:0101:0001::2/64

R1
ipv6
int g0/0/1
ipv6 enable
ipv6 add 2002:1701:0101:0001::1/64

int loo0
ipv6 enable
ipv6 add 2002:1701:0101:0002::1/65

int loo1
ipv6 enable
ipv6 add 2002:1701:0101:0002:8000::1/65

Ripng

R1
int loo0
ripng 1 enable
int loo1
ripng 1 enable
intg0/0/0
ripng 1 enable

int g0/0/0
ripng 1summary-address 2002:1701:0101:0002:: 64 汇总

R2
int g0/0/0
ripng 1enable
int loo0
ripng 1enable

display ipv6 routing-table protocol ripng 查看路由表

Tunnel

R2
int tunn 0/0/0I
pv6 enable
ipv6 add 2002:1701:0101:0003::1/64
tunnel-protocol ipv6-ipv4 6to4
source 23.1.1.1
ipv6 rote-static 2002:: 16 tunnel0/0/0 定义只要以2002::16开头的流量都走tunnel

r1上还没有到r2tunnle的路由,可以给r1写一条缺省,也可以在r2上下放缺省到
ripng
int g0/0/0
ripng default-route only only代表只发缺省
Korginate将所有的下发,缺省和环回

公网右边部分

ipv6地址:基于r4的公网接口演算所得
34.1.1.
22002:2201:0102:: /48
2002:2201:0102:: /49 AS1
2002:2201:0102:: /64 - 2001:2201:0102:7fff::/64

2002:2201:0102:8000:: /49 AS2
2002::2201:0102:8000:: /64 - 2002:2201:0102:ffff::/64

AS1

R4
ipv6
int loo0
ipv6 add 2002:2201:0102::1/64
int g0/0/1
ipv6 enavle
ipv6 add 2002:2201:0102:0001::1/64

R5
ipv6
int g0/0/0
ipv6 enable
ipv6 add 2002:2201:0102::2/64

AS2

R5
ipv6
int g0/0/1
ipv6 enable
ipv6 add 2002:2201:0102:8000::/64
int g0/0/1
ipv6 enable
ipv6 add 2002:2201:0102:8001::/64

R6
ipv6
int loo0
ipv6 enable
ipv6 add 2002:2201:0102:8002::/64
int g0/0/0
ipv6 enavle
ipv6 add 2002:2201:0102:8001::2/64
int g0/0/1
ipv6 enable
ipv6 2002:2201:0102:8003::1/64

R7
ipv6
int g0/0/0
ipv6 enable
ipv6 add 2002:2201:0102:8003::2/64
int loo0
ipv6 enable
ipv6 add 2002:2201:0102:8004::1/64
int g0/0/1
ipv6 enable
ipv6 2002:2201:0102:8005::1/64

R8
ipv6
int g0/0/0
ipv6 enable
ipv6 add 2002:2201:0102:8005::2/64

int loo0
ipv6 enable
ipv6 add 2002:2201:0102:8006::1/64

先使内网可通

ospf协议

R5
ospfv3
router-id 5.5.5.5
int g0/0/10
spfv3 1 area 0
int loo0
ospfv3 1 area 0
R6
ospfv3
router-id 6.6.6.6
int g0/0/0
ospfv3 1 area 0
int loo0
ospfv3 1 area 0
ing 0/0/1
ospfv3 1 area 0
R7
ospfv3
router-id 7.7.7.7
int g0/0/0
ospfv3 1 area 0
int loo0
ospfv3 1 area 0
int g0/0/1
ospfv3 1 area 0
R8
ospfv3
router-id 8.8.8.8
int g0/0/0
ospfv3 1 area 0
int loo0
ospfv3 1 area 0

查看邻居关系
display ospfv3 peer
查看ospfv3的路由表
display ipv6 routing-table protocol ospfv3

r4-5之间建立bgp邻居关系

Bgp 1

R4
router-id 4.4.4.4
peer 2002:2201:102:1::2 as-number 2
ipv6-family
peer 2002:2201:102:1::2 enable 进入ipv6再次宣告
R5
bgp 64512
confenderration id 2
router-id 5.5.5.5
peer 2002:2201:102:1::1 as-unmber 1
ipv6
ipv6-family
peer 2002:2201:102:1::1 enable

查看bgp邻居关系Display bgp ipv6 peer

r5/6/7/8之间创建环回用来建邻,不用再次宣告(ipv6属于接口宣告,已自动宣告)多属组

R5
int loo0
ipv6 add 5::5/64
R6
int loo0
ipv6 add 6::6/64
R7
int loo0
ipv6 add 7::7/64
R8
int loo0
ipv6 add 8::8/64

r5/6/7之间建立联邦

R5
bgp 64512
confederation id 2
router-id 5.5.5.5
peer 6::6 as-number 64512Peer 6::6 connect-interface loopback 0 5::5 更新环回源(默认使用的使第一次配的2002的地址对端环回建邻,对不上,需指明5::5)
ipv6
ipv6-family
peer 6::6 enable

R6
bgp 64512
confederation id 2
router-id 6.6.6.6
peer 5::5 as-number 64512
peer 5::5 conect-interface loopback 0 6::6
peer 7::7 as-number 64512
peer 7::7 connect–interface loopback 0 6::6
ipv6
ipv6 family
peer 5::5 enable
peer 7::7 enable
R7
Bgp 64512
confederation id 2
router-id 7.7.7.7
peer 6::6 as-number 64512
peer 6::6 connect-interface loopback 0 7::7
pee 8::8 as-number 64513
peer 8::8 connect-interface loopback0 7::7
peer 8::8 ebgp-max-hop 2
ipv6
ipv6 family
peer 6::6 enable
peer 8::8 enable

R8
bgp 64513
congederation id 2
router-id 8.8.8.8
peer 7::7 as-number 64512
peer 7::7 connect-interface loopback 0 8::8
peer 7::7 ebgp-max-hop 2
ipv6
ipv6 family
peer 7::7 enable

查看bgp邻居关系
display bgp ipv6 peer

r4的as1区域访问左边靠6to4tunnel,访问右边靠bgp路由,as2区域访问右边靠缺省

tunnel 6to4

R4
int tunnel 0/0/0
ipv6 add 2002:2201:0102:2::1/64
tunnel-protocol ipv6-ipv4 6to4
source 34.1.1.2

r4访问左边的路由

ipv6 route-static 2002:: 16 tunnel 0/0/0

r5宣告—上汇总,空接口放环

ipv6 route-static 2002:2201:0102:8000:: 49 null 0
network 2002:2201:0102:8000:: 49 r5到有右边路由的汇总路由,宣告给邻居r4R4有了这条路由就可以访问右边,r5上还有一空接口防环,r4过来的多余流量就可以丢入黑洞

此时as2无法到左边,因为r4没有宣告过左边的路由 宣告r4上到右边的静态路由

bgp 1
ipv6-family
network 2002:: 16
display bgp ipv6 routing-table 查看ipv6路由表
此时r5学到了这条路由,并且优,可以传递给r6
但r6只能学到不优(无法传递),原因:下一跳不可达
R5
ipv6
ipv6-familay
peer 6::6 next-hop-local
此时6优的但基于ibgp水平分割,6无法传递给7

配置反射器

R6
bgp64512
ipv6 ipv6-family
peer 7::7 reflect-client

测试

ping ipv6 2002:1701:0102:2:8000::1

相关文章: