Tuesday, April 6, 2021

BGP Traffic engineering on two leased lines and two subnets

Network Diagram

Background: As the network diagram above, we are trying to force traffic between leased lines based on subnet between LON1 and HK_Office; I am trying to use loopback interface on HK_Office router to mimicking different network traffic; There is a cross route injection between OSPF and iBGP due to the nature of OSPF isn't a tool to do traffic engineering, I was trying to use local-preference seem but it doesn't seems working, and I checked to show IP BGP from LON1 (Shown below), Next Hop indicates two-path have same IP 172.16.0.1, what exactly went wrong?

For VIP network 10.10.0.1/24 :

VIP leased line - Primary (Or active)

General leased line - Secondary in case primary failed (Or passive)

For General network 192.168.10.1/24 :

General leased line - Primary (Or active)

VIP leased line as - Secondary in case primary failed (Or passive)

---------------------

IP Routes detail are below,

LON1:

LON1#show ip bgp BGP table version is 7, local router ID is 192.168.0.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 r i10.0.0.0/24 192.168.0.1 0 50 0 ? r>i 10.0.0.1 0 5000 0 ? * i10.10.0.1/32 172.16.0.1 2 50 0 ? *>i 172.16.0.1 2 5000 0 ? * i172.16.0.0/24 192.168.0.1 0 50 0 ? *>i 10.0.0.1 0 5000 0 ? * i192.168.0.0 192.168.0.1 0 50 0 i * i 10.0.0.1 0 5000 0 i *> 0.0.0.0 0 32768 i * i192.168.10.1/32 172.16.0.1 2 50 0 ? *>i 172.16.0.1 2 5000 0 ? LON1#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 192.168.10.0/32 is subnetted, 1 subnets B 192.168.10.1 [200/2] via 172.16.0.1, 1d16h 172.16.0.0/24 is subnetted, 1 subnets B 172.16.0.0 [200/0] via 10.0.0.1, 1d16h 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks B 10.10.0.1/32 [200/2] via 172.16.0.1, 1d16h C 10.0.0.0/24 is directly connected, FastEthernet0/0 C 192.168.0.0/24 is directly connected, FastEthernet0/1 LON1#show ip bgp sum BGP router identifier 192.168.0.2, local AS number 64512 BGP table version is 7, main routing table version 7 5 network entries using 585 bytes of memory 11 path entries using 572 bytes of memory 8/3 BGP path/bestpath attribute entries using 992 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP using 2149 total bytes of memory BGP activity 5/0 prefixes, 11/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.0.0.1 4 64512 2415 2415 7 0 0 1d16h 5 192.168.0.1 4 64512 2415 2415 7 0 0 1d16h 5 

HK2:

HK2#show ip bgp BGP table version is 6, local router ID is 192.168.0.1 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 *> 10.0.0.0/24 0.0.0.0 0 32768 ? *> 10.10.0.1/32 172.16.0.1 2 32768 ? *> 172.16.0.0/24 0.0.0.0 0 32768 ? * i192.168.0.0 192.168.0.2 0 50 0 i * i 10.0.0.2 0 5000 0 i *> 0.0.0.0 0 32768 i *> 192.168.10.1/32 172.16.0.1 2 32768 ? HK2#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 192.168.10.0/32 is subnetted, 1 subnets O 192.168.10.1 [110/2] via 172.16.0.1, 1d16h, FastEthernet1/0 172.16.0.0/24 is subnetted, 1 subnets C 172.16.0.0 is directly connected, FastEthernet1/0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks O 10.10.0.1/32 [110/2] via 172.16.0.1, 1d16h, FastEthernet1/0 C 10.0.0.0/24 is directly connected, FastEthernet0/0 C 192.168.0.0/24 is directly connected, FastEthernet0/1 HK2#show ip bgp sum BGP router identifier 192.168.0.1, local AS number 64512 BGP table version is 6, main routing table version 6 5 network entries using 585 bytes of memory 7 path entries using 364 bytes of memory 7/3 BGP path/bestpath attribute entries using 868 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP using 1817 total bytes of memory BGP activity 5/0 prefixes, 7/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.0.0.2 4 64512 2419 2419 6 0 0 1d16h 1 192.168.0.2 4 64512 2419 2419 6 0 0 1d16h 1 HK2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.10.1 1 FULL/DR 00:00:37 172.16.0.1 FastEthernet1/0 HK2#show ip ospf da HK2#show ip ospf database OSPF Router with ID (192.168.0.1) (Process ID 10) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 192.168.0.1 192.168.0.1 1981 0x80000049 0x001F78 1 192.168.10.1 192.168.10.1 351 0x8000004A 0x0026B1 3 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 172.16.0.1 192.168.10.1 351 0x80000049 0x00548C Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.0.0.0 192.168.0.1 1981 0x80000048 0x00C420 0 192.168.0.0 192.168.0.1 1981 0x80000048 0x0095EF 0 

HK_Office:

HK_Office#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.10.0/24 is directly connected, Loopback1 172.16.0.0/24 is subnetted, 1 subnets C 172.16.0.0 is directly connected, FastEthernet1/0 10.0.0.0/24 is subnetted, 2 subnets C 10.10.0.0 is directly connected, Loopback0 O E2 10.0.0.0 [110/20] via 172.16.0.2, 1d16h, FastEthernet1/0 O E2 192.168.0.0/24 [110/20] via 172.16.0.2, 1d16h, FastEthernet1/0 HK_Office#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.0.1 1 FULL/BDR 00:00:31 172.16.0.2 FastEthernet1/0 HK_Office#show ip ospf database OSPF Router with ID (192.168.10.1) (Process ID 10) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 192.168.0.1 192.168.0.1 108 0x8000004A 0x001D79 1 192.168.10.1 192.168.10.1 512 0x8000004A 0x0026B1 3 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 172.16.0.1 192.168.10.1 512 0x80000049 0x00548C Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.0.0.0 192.168.0.1 108 0x80000049 0x00C221 0 192.168.0.0 192.168.0.1 108 0x80000049 0x0093F0 0 

---------------------

Configs are below,

LON1:

router bgp 64512 bgp log-neighbor-changes neighbor 10.0.0.1 remote-as 64512 neighbor 192.168.0.1 remote-as 64512 ! address-family ipv4 neighbor 10.0.0.1 activate neighbor 10.0.0.1 route-map VIP_NET in neighbor 192.168.0.1 activate neighbor 192.168.0.1 route-map GENERAL_NET in no auto-summary no synchronization network 10.0.0.0 network 192.168.0.0 exit-address-family ip prefix-list ALL seq 5 permit 0.0.0.0/0 le 32 ip prefix-list PREFIX-TO-HK-GENERAL-NETWORK seq 5 permit 192.168.10.1/32 ip prefix-list PREFIX-TO-HK-VIP-NETWORK seq 5 permit 10.10.0.1/32 route-map GENERAL_NET permit 5 set local-preference 50 route-map GENERAL_NET permit 10 match ip address prefix-list PREFIX-TO-HK-VIP-NETWORK route-map GENERAL_NET permit 20 match ip address prefix-list PREFIX-TO-HK-GENERAL-NETWORK set local-preference 5000 route-map VIP_NET permit 5 set local-preference 5000 route-map VIP_NET permit 10 match ip address prefix-list PREFIX-TO-HK-VIP-NETWORK set local-preference 5000 route-map VIP_NET permit 20 match ip address prefix-list PREFIX-TO-HK-GENERAL-NETWORK set local-preference 50 

HK2:

router ospf 10 log-adjacency-changes redistribute connected subnets redistribute bgp 64512 metric-type 1 subnets passive-interface default no passive-interface FastEthernet1/0 network 172.16.0.0 0.0.0.255 area 0 ! router bgp 64512 bgp log-neighbor-changes neighbor 10.0.0.2 remote-as 64512 neighbor 192.168.0.2 remote-as 64512 ! address-family ipv4 redistribute connected redistribute ospf 10 neighbor 10.0.0.2 activate neighbor 10.0.0.2 route-map VIP_NET in neighbor 10.0.0.2 route-map VIP_NET out neighbor 192.168.0.2 activate neighbor 192.168.0.2 route-map GENERAL_NET in neighbor 192.168.0.2 route-map GENERAL_NET out no auto-summary no synchronization network 10.0.0.0 network 172.16.0.0 network 192.168.0.0 exit-address-family ip prefix-list ALL seq 5 permit 0.0.0.0/0 le 32 ! ip prefix-list PREFIX-TO-HK-GENERAL-NETWORK seq 5 permit 192.168.10.1/32 ! ip prefix-list PREFIX-TO-HK-VIP-NETWORK seq 5 permit 10.10.0.1/32 no cdp log mismatch duplex ! route-map GENERAL_NET permit 5 set local-preference 50 ! route-map GENERAL_NET permit 10 match ip address prefix-list PREFIX-TO-HK-VIP-NETWORK set local-preference 50 ! route-map GENERAL_NET permit 20 match ip address prefix-list PREFIX-TO-HK-GENERAL-NETWORK set local-preference 5000 ! route-map VIP_NET permit 5 set local-preference 5000 ! route-map VIP_NET permit 10 match ip address prefix-list PREFIX-TO-HK-VIP-NETWORK set local-preference 5000 ! route-map VIP_NET permit 20 match ip address prefix-list PREFIX-TO-HK-GENERAL-NETWORK set local-preference 50 

HK_Office:

router ospf 10 log-adjacency-changes redistribute connected passive-interface default no passive-interface FastEthernet1/0 network 10.10.0.0 0.0.0.255 area 0 network 172.16.0.0 0.0.0.255 area 0 network 192.168.10.0 0.0.0.255 area 0 


No comments:

Post a Comment