Search This Blog

Saturday, June 2, 2012

BGP default-route


Let’s take the following scenario:



R3 is EBGP peering with R2 where there are 3 ways to advertise default route:

     1.       Use neighbor x.x.x.x default-originate
R3 configuration:
router bgp 65003
 no synchronization
 bgp log-neighbor-changes
 network 192.168.30.0
 neighbor 10.1.23.2 remote-as 65012
 neighbor 10.1.23.2 default-originate
 no auto-summary

R3 will advertise default-route to R2 with or without having default-route in his routing table.

R3:
R3#sh 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.30.0/24 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.23.0 is directly connected, FastEthernet0/0
C       10.1.45.0 is directly connected, FastEthernet0/1

R2:
R2#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 10.1.23.3 to network 0.0.0.0

B    192.168.30.0/24 [20/0] via 10.1.23.3, 02:51:33
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.12.0 is directly connected, FastEthernet0/0
C       10.1.23.0 is directly connected, FastEthernet0/1
B*   0.0.0.0/0 [20/0] via 10.1.23.3, 00:15:19
     
     2.        Use default-information originate and redistribute static
R3 configuration:
router bgp 65003
 no synchronization
 bgp log-neighbor-changes
 network 192.168.30.0
 neighbor 10.1.23.2 remote-as 65012
default-information originate
redistribute static
no auto-summary
!
Ip route 0.0.0.0 0.0.0.0 null0

R3:
R3#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 0.0.0.0 to network 0.0.0.0

C    192.168.30.0/24 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.23.0 is directly connected, FastEthernet0/0
C       10.1.45.0 is directly connected, FastEthernet0/1
S*   0.0.0.0/0 is directly connected, Null0

R2:
R2#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 10.1.23.3 to network 0.0.0.0

B    192.168.30.0/24 [20/0] via 10.1.23.3, 00:01:57
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.12.0 is directly connected, FastEthernet0/0
C       10.1.23.0 is directly connected, FastEthernet0/1
B*   0.0.0.0/0 [20/0] via 10.1.23.3, 00:01:57

     3.       Using network 0.0.0.0 command where R3 does have default-route in his routing table (from static or any other dynamic routing protocol)
R3 configuration:
router bgp 65003
 no synchronization
 bgp log-neighbor-changes
 network 192.168.30.0
 neighbor 10.1.23.2 remote-as 65012
network 0.0.0.0
no auto-summary

R3:
R3#show ip ro
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 10.1.45.4 to network 0.0.0.0

C    192.168.30.0/24 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.23.0 is directly connected, FastEthernet0/0
C       10.1.45.0 is directly connected, FastEthernet0/1
O*E2 0.0.0.0/0 [110/1] via 10.1.45.4, 00:00:28, FastEthernet0/1

R2:
R2#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 10.1.23.3 to network 0.0.0.0

B    192.168.30.0/24 [20/0] via 10.1.23.3, 00:00:32
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.12.0 is directly connected, FastEthernet0/0
C       10.1.23.0 is directly connected, FastEthernet0/1
B*   0.0.0.0/0 [20/1] via 10.1.23.3, 00:00:32

To summarize this:

Command
Default-route in routing table
Source
Router bgp 65003
Neighbor x.x.x.x default-originate
No
N/A
Router bgp 65003
Default-information originate
Redistribute <protocol>
Yes
Static, OSPF, RIP, EIGRP
Router bgp 65003
Network 0.0.0.0
Yes
Static, OSPF, RIP, EIGRP, BGP
No special command
Yes
EBGP, IBGP


No comments:

Post a Comment