Вы находитесь на странице: 1из 6

Using Route Tag to Store BGP AS-Path Lab

Lab Purpose:

1、Solve AS-PATH attribute missing issue during BGP and IGP redistribution.

2、Master route tag store and restore BGP AS-PATH attribute configuration.

Lab Steps:

1、Finish basic IP configuration.

2、Config OSPF between R2 and R3.

R2(config)#router ospf 1

R2(config-router)#network 172.16.1.0 0.0.0.255 area 0

R2(config-router)#exit

R2(config)#exit

R3(config)#router ospf 1

R3(config-router)#network 172.16.1.0 0.0.0.255 area 0

1
R3(config-router)#exit

R3(config)#exit

3、Check OSPF neighbor relationship between R2 and R3.

R2#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

192.168.2.1 1 FULL/BDR 00:00:32 172.16.1.2 FastEthernet0/0

4、Establish BGP relationship between R1 R2, R3 R4. No BGP relationship between R2 R3.

R1(config)#router bgp 64512

R1(config-router)#neighbor 192.168.1.2 remote-as 64513

R1(config-router)#network 130.130.1.0 mask 255.255.255.0

R1(config-router)#exit

R2(config)#router bgp 64513

R2(config-router)#neighbor 192.168.1.1 remote-as 64512

R2(config-router)#network 192.168.1.0 mask 255.255.255.0

R2(config-router)#exit

R2(config)#exit

R3(config)#router bgp 64513

R3(config-router)#neighbor 192.168.2.2 remote-as 64514

R3(config-router)#network 192.168.2.0 mask 255.255.255.0

R3(config-router)#exit

R3(config)#exit

R4(config)#router bgp 64514

R4(config-router)#neighbor 192.168.2.1 remote-as 64513

2
5、Confirm BGP relationship on R2 and R3.

R2#show ip bgp summary

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

192.168.1.1 4 64512 8 8 3 0 0 00:03:37 2

R3#show ip bgp summary

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

192.168.2.2 4 64514 6 6 2 0 0 00:01:46 1

6、Check routing table on R4, we can see no routes have been learn.

R4#show ip route

Gateway of last resort is not set

C 192.168.2.0/24 is directly connected, Serial1/0

7、Config redistribution between BGP and OSPF on R2 R3.

R2(config)#router ospf 1

R2(config-router)#redistribute bgp 64513 subnets

R2(config-router)#exit

R2(config)#

R2(config)#router bgp 64513

R2(config-router)#redistribute ospf 1 match external internal

R2(config-router)#

R3(config)#router bgp 64513

R3(config-router)#redistribute ospf 1 match internal external

R3(config-router)#exit

R3(config)#

3
R3(config)#router ospf 1

R3(config-router)#redistribute bgp 64513 subnets

R3(config-router)#exit

R3(config)#exit

8、Check routing table again on R4, we can see routes are there.

R4#show ip route

…………

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 1 subnets

B 172.16.1.0 [20/0] via 192.168.2.1, 00:03:18

130.130.0.0/24 is subnetted, 1 subnets

B 130.130.1.0 [20/1] via 192.168.2.1, 00:03:18

B 192.168.1.0/24 [20/1] via 192.168.2.1, 00:03:18

C 192.168.2.0/24 is directly connected, Serial1/0

9、Check BGP routing table on R4, we can see routes are there but some BGP attributes are
missing. Such as item 130.130.1.0/24 from AS 64512, the AS-PATH of this item should be
64521 65513, but in the BGP table it only appears AS 64513, the BGP origin attribute is also
incomplete.

R4#show ip bgp

BGP table version is 5, local router ID is 192.168.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale

Origin codes: i – IGP, e – EGP, ? – incomplete

Network Next Hop Metric LocPrf Weight Path

*> 130.130.1.0/24 192.168.2.1 1 0 64513 ?

*> 172.16.1.0/24 192.168.2.1 0 0 64513 ?

4
*> 192.168.1.0 192.168.2.1 1 0 64513 ?

* 192.168.2.0 192.168.2.1 0 0 64513 i

*> 0.0.0.0 0 32768 i

10、As OSPF can not recognize BGP AS-PATH attribute from redistribution, so there is BGP
AS-PATH attribute missing issue. To solve this problem, route tag should be introduced. We use
route tag to store BGP attribute before redistribution from BGP to OSPF on R2, and restore it by
redistribution from OSPF to BGP on R3.

11、Store AS-PATH attribute in route tag on R2.

R2(config)#route-map SET_TAG permit 10

R2(config-route-map)#set automatic-tag

R2(config-route-map)#exit

R2(config)#

R2(config)#router bgp 64513

R2(config-router)#table-map SET_TAG

R2(config-router)#exit

12、Restore AS-PATH attribute from route tag on R3.

R3(config)#route-map GET_TAG permit 10

R3(config-route-map)#set as-path tag

R3(config-route-map)#set origin igp

R3(config)#router bgp 64513

R3(config-router)#redistribute ospf 1 match external internal route-map GET_TAG

R3(config-router)#exit

13、Check BGP routing table on R4, we can see the AS-PATH for item 130.130.1.0/24 is
complete now, and originate from IGP.

R4#show ip bgp

5
BGP table version is 15, local router ID is 192.168.2.2

Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,

r RIB-failure, S Stale

Origin codes: i – IGP, e – EGP, ? – incomplete

Network Next Hop Metric LocPrf Weight Path

*> 130.130.1.0/24 192.168.2.1 1 0 64513 64512 i

*> 172.16.1.0/24 192.168.2.1 0 0 64513 i

*> 192.168.1.0 192.168.2.1 1 0 64513 i

* 192.168.2.0 192.168.2.1 0 0 64513 i

*> 0.0.0.0 0 32768 i

14、Ping test on R4.

R4#ping 130.130.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 130.130.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 88/138/220 ms

Вам также может понравиться