We saw that one of the usual reasons people have for wanting to run BGP is being multi-homed, either to one or two ISP's. We examined the various "degrees of BGP" that you might wish to use, matching what you do to your needs and your skills. I hope that left you with the idea that there are some finer gradations in between "no BGP" and "full Internet routing with BGP", sort of a 1-10 scale of increasingly difficult things to attempt.
And don't assume that high-quality Internet connectivity, with redundancy, requires BGP. BGP just buys you the capability of doing more complex things, more optimal routing. Rarely do we want or need "perfect" routing (in the sense of the absolute best path). We trade off optimality for smaller routing tables, stability, and ease of troubleshooting.
Default routing is the usual answer to not doing BGP. See http://www.netcraftsmen.net/welcher/papers/default.htm for some thoughts on default routing.
We also saw that redistributing, either into or out of BGP, is rarely necessary or appropriate.
After such a big introduction, I feel compelled to warn the reader: there's a lot to say about BGP, and we're not going to say it here. The ultimate reference on BGP is the book Internet Routing Architectures, Bassam Halabi, Cisco Press, 1997. For more ideas (and configurations) relating to the discussions in last months' article, read the fine book!
To aid in categorizing the various levels of complexity one might tackle with BGP, I introduced some diagrams like the following. We then discussed them, with some caveats as to what they don't show.
Diagram 1: one connection to ISP: use default routing!
Diagram 2: one corporate gateway router, two connections to ISP (possibly geographically diverse).
ip route 0.0.0.0 0.0.0.0 Serial 0
router eigrp 1
network 200.30.50.0
redistribute static metric 10 2000 255 1 1500
distribute-list 1 out static
access-list 1 permit 0.0.0.0 0.0.0.0
access-list 1 deny any
For reference; "ip default-gateway" only applies when your router isn't a router. (That's a riddle: when is a router not a router?) Answer: when you configure "no ip routing" or when you boot in RXBOOT mode.
ip route 0.0.0.0 0.0.0.0 200.30.30.1 70
ip route 0.0.0.0 0.0.0.0 200.30.40.1
router bgp 1000
network 200.30.50.0 mask 255.255.255.0
neighbor 200.30.30.1 remote-as 1
neighbor 200.30.30.1 route-map NOROUTES in
neighbor 200.30.30.1 route-map PREFER1 out
neighbor 200.30.40.1 remote-as 1
neighbor 200.30.40.1 route-map NOROUTES in
neighbor 200.30.40.1 route-map PREFER2 out
no auto-summary
route-map NOROUTES deny 10
route-map PREFER1 permit 10
set metric 100
route-map PREFER2 permit 10
set metric 50
The static routes to 0.0.0.0 /0 take care of default. We of course redistribute these into our internal protocol, not shown in this example (probably something like in the first example). The floating static route (ending in 70) only applies if and when the other static route fails, i.e. when 200.30.40.1 is unreachable.
There are other possibilities for Diagram 2, such as load balancing across
equal speed links. Since space is short, let's move on and look at a more
complicated scenario. (Those who are paying close attention will note that
we've omitted our prior Diagram 3, for space reasons).
Diagram 4: two corporate gateway routers, geographically diverse on both ends.
Note also that this shuffles traffic between A and B somewhat, depending on connectivity to the rest of our network (not shown). Traffic for 145.1.0.0 /16 that arrives at A gets sent to B. Other traffic (following the default route) that arrives at B gets sent to A. Balancing could be done by "tuning" to allow information about additional AS's in via B.
Question: do we summarize 145.1 /16?
Another approach is to reason that you only care to take "the best exit" to destinations in AS 1 (or customer AS's). The idea would be to redistribute information about the ISP network 145.1.0.0 /16 carefully at A and B, into our IGP. The question there is, since we redistribute with a default metric, we really are only picking the closer exit point, which we could do much more simply with default routing. If we want the redistributed routes to contain more information, we need to fiddle with route maps to influence the metrics.
As part of this alternative strategy, both A and B could then also advertise default into the IGP. This allows traffic to fail over to the other link in case of a failure.
However, this alternative isn't what I've built and tested.
By the way, I've also used the Serial 0 addresses on routers A and B for iBGP neighbors, for simplicity, whereas loopback addresses might be somewhat preferable. You'll also notice I tried this on 2500's, not on 7x00's (didn't happen to have any with me this week). Just imagine that "Serial 0" is "Serial 0/0", and "Serial 1" is "Serial 1/0". Since back-to-back serial links were used, the configurations also show "clock rate" commands for the DCE-cabled serial port. And I realize I've never really written about route maps -- but space is tight, so that will have to wait for another article (sometime).
Current configuration:
!
version 11.2
!
hostname routerA
!
enable password san-fran
!
ip subnet-zero
no ip domain-lookup
ip host routerC 145.1.0.199 200.30.30.1
ip host routerD 145.1.0.200 200.30.40.1
ip host routerA 200.30.30.2 200.50.80.65 200.50.80.1
ip host routerB 200.30.40.2 200.50.80.97 200.50.80.2
ip host CorpRouterG 200.50.80.66 200.50.80.129
ip host CorpRouterH 200.50.80.98 200.50.80.130
ip host ISProuterE 145.1.0.201
ip host ISProuterF 145.1.0.202
!
interface Ethernet0
ip address 200.50.80.65 255.255.255.224
!
interface Serial0
ip address 200.30.30.2 255.255.255.252
bandwidth 56
!
interface Serial1
ip address 200.50.80.1 255.255.255.252
bandwidth 56
!
router eigrp 1
redistribute static metric 10 2000 255 1 1500
network 200.50.80.0
distribute-list 1 out static
!
router bgp 1000
no synchronization
network 200.50.80.0 mask 255.255.240.0
neighbor 200.30.30.1 remote-as 1
neighbor 200.30.30.1 route-map ISPONLY in
neighbor 200.30.30.1 filter-list 10 out
neighbor 200.50.80.2 remote-as 1000
neighbor 200.50.80.2 next-hop-self
no auto-summary
!
no ip classless
ip route 0.0.0.0 0.0.0.0 Serial0 200
ip route 200.50.80.0 255.255.240.0 Null0
ip as-path access-list 10 permit ^$
ip as-path access-list 20 permit ^1$
access-list 1 permit 0.0.0.0
access-list 1 deny any
route-map ISPONLY permit 10
match as-path 20
set local-preference 300
!
line vty 0 4
exec-timeout 0 0
password cisco
login
!
end
routerA>sh ip rou
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1,
L2 - IS-IS level-2, * - candidate default
U - per-user static route, o -
ODR
Gateway of last resort is 200.50.80.2 to network 0.0.0.0
B 145.1.0.0/16 [20/0] via 200.30.30.1, 00:09:07
200.50.80.0/24 is variably subnetted, 4 subnets,
2 masks
D 200.50.80.128/27 [90/46251776]
via 200.50.80.66, 01:07:07, Ethernet0
C 200.50.80.0/30 is directly connected,
Serial1
D 200.50.80.96/27 [90/46277376]
via 200.50.80.66, 01:06:59, Ethernet0
C 200.50.80.64/27 is directly connected,
Ethernet0
200.30.30.0/24 is variably subnetted, 2 subnets,
2 masks
D 200.30.30.0/24 is a summary, 00:09:30,
Null0
C 200.30.30.0/30 is directly connected,
Serial0
B 200.30.40.0/24 [20/0] via 200.30.30.1, 00:09:07
D*EX 0.0.0.0/0 [170/257024000] via 200.50.80.2, 00:11:00, Serial1
S 200.50.80.0/20 is directly connected, Null0
routerA>sh ip bgp
BGP table version is 24, local router ID is 200.50.80.65
Status codes: s suppressed, d damped, h history, * valid, > best,
i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop Metric LocPrf
Weight Path
*> 145.1.0.0 200.30.30.1
0 300 0 1 i
*> 200.30.30.0 200.30.30.1
46226176 300 0 1 i
*> 200.30.40.0 200.30.30.1
300 0 1 i
* i200.50.80.0/20 200.50.80.2
0 100 0 i
*>
0.0.0.0
0 32768 i
Current configuration:
!
version 11.2
!
hostname routerB
!
enable password san-fran
!
ip subnet-zero
no ip domain-lookup
ip host routerC 145.1.0.199 200.30.30.1
ip host routerD 145.1.0.200 200.30.40.1
ip host routerA 200.30.30.2 200.50.80.65 200.50.80.1
ip host routerB 200.30.40.2 200.50.80.97 200.50.80.2
ip host CorpRouterG 200.50.80.66 200.50.80.129
ip host CorpRouterH 200.50.80.98 200.50.80.130
ip host ISProuterE 145.1.0.201
ip host ISProuterF 145.1.0.202
!
interface Ethernet0
ip address 200.50.80.97 255.255.255.224
!
interface Serial0
ip address 200.30.40.2 255.255.255.252
bandwidth 56
!
interface Serial1
ip address 200.50.80.2 255.255.255.252
bandwidth 56
clockrate 56000
!
router eigrp 1
redistribute static metric 10 2000 255 1 1500
network 200.50.80.0
distribute-list 1 out static
!
router bgp 1000
no synchronization
network 200.50.80.0 mask 255.255.240.0
neighbor 200.30.40.1 remote-as 1
neighbor 200.30.40.1 route-map NOROUTES in
neighbor 200.30.40.1 filter-list 10 out
neighbor 200.50.80.1 remote-as 1000
neighbor 200.50.80.1 next-hop-self
no auto-summary
!
no ip classless
ip route 0.0.0.0 0.0.0.0 Serial0
ip route 200.50.80.0 255.255.240.0 Null0
ip as-path access-list 10 permit ^$
access-list 1 permit 0.0.0.0
access-list 1 deny any
route-map NOROUTES deny 10
!
line vty 0 4
exec-timeout 0 0
password cisco
login
!
end
routerB#sh ip rou
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1,
L2 - IS-IS level-2, * - candidate default
U - per-user static route, o -
ODR
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
B 145.1.0.0/16 [200/0] via 200.50.80.1, 00:08:47
200.50.80.0/24 is variably subnetted, 4 subnets,
2 masks
D 200.50.80.128/27 [90/46251776]
via 200.50.80.98, 01:06:46, Ethernet0
C 200.50.80.0/30 is directly connected,
Serial1
C 200.50.80.96/27 is directly connected,
Ethernet0
D 200.50.80.64/27 [90/46277376]
via 200.50.80.98, 01:06:39, Ethernet0
B 200.30.30.0/24 [200/46226176] via 200.50.80.1, 00:08:47
200.30.40.0/24 is variably subnetted, 2 subnets,
2 masks
D 200.30.40.0/24 is a summary, 00:10:41,
Null0
C 200.30.40.0/30 is directly connected,
Serial0
S* 0.0.0.0/0 is directly connected, Serial0
S 200.50.80.0/20 is directly connected, Null0
routerB#sh ip bgp
BGP table version is 15, local router ID is 200.50.80.97
Status codes: s suppressed, d damped, h history, * valid, > best,
i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop Metric LocPrf
Weight Path
*>i145.1.0.0 200.50.80.1
0 300 0 1 i
*>i200.30.30.0 200.50.80.1
46226176 300 0 1 i
*>i200.30.40.0 200.50.80.1
0 300 0 1 i
*> 200.50.80.0/20 0.0.0.0
0 32768 i
* i
200.50.80.1
0 100 0 i
Gateway of last resort is not set
C 145.1.0.0/16 is directly connected, Ethernet0
200.30.30.0/24 is variably subnetted, 2 subnets,
2 masks
D 200.30.30.0/24 is a summary, 00:00:48,
Null0
C 200.30.30.0/30 is directly connected,
Serial0
D 200.30.40.0/24 [90/46251776] via 145.1.0.200, 00:00:44,
Ethernet0
B 200.50.80.0/20 [20/0] via 200.30.30.2, 00:08:07
routerC#sh ip bgp
BGP table version is 38, local router ID is 200.30.30.1
Status codes: s suppressed, d damped, h history, * valid, > best,
i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop Metric LocPrf
Weight Path
* i145.1.0.0 145.1.0.200
0 100 0 i
*>
0.0.0.0
0 32768 i
*> 200.30.30.0 0.0.0.0
46226176 32768 i
*>i200.30.40.0 145.1.0.200
46226176 100 0 i
*> 200.50.80.0/20 200.30.30.2
0
0 1000 i
* i
200.30.40.2
0 100 0 1000 i
routerC#sh run
Building configuration...
Current configuration:
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname routerC
!
enable password san-fran
!
ip subnet-zero
no ip domain-lookup
ip host routerC 145.1.0.199 200.30.30.1
ip host routerD 145.1.0.200 200.30.40.1
ip host routerA 200.30.30.2 200.50.80.65 200.50.80.1
ip host routerB 200.30.40.2 200.50.80.97 200.50.80.2
ip host CorpRouterG 200.50.80.66 200.50.80.129
ip host CorpRouterH 200.50.80.98 200.50.80.130
ip host ISProuterE 145.1.0.201
ip host ISProuterF 145.1.0.202
!
interface Ethernet0
ip address 145.1.0.199 255.255.0.0
!
interface Serial0
ip address 200.30.30.1 255.255.255.252
bandwidth 56
clockrate 56000
!
router eigrp 2
redistribute bgp 1 metric 1000 200 255 1 1500
network 145.1.0.0
distribute-list 30 out bgp 1
!
router bgp 1
network 145.1.0.0
network 200.30.30.0
neighbor 145.1.0.200 remote-as 1
neighbor 200.30.30.2 remote-as 1000
!
no ip classless
access-list 30 permit any
!
line vty 0 4
exec-timeout 0 0
password cisco
login
!
end
Gateway of last resort is not set
C 145.1.0.0/16 is directly connected, Ethernet0
D 200.30.30.0/24 [90/46251776] via 145.1.0.199, 00:01:06,
Ethernet0
200.30.40.0/24 is variably subnetted, 2 subnets,
2 masks
D 200.30.40.0/24 is a summary, 00:01:01,
Null0
C 200.30.40.0/30 is directly connected,
Serial0
B 200.50.80.0/20 [20/0] via 200.30.40.2, 00:09:46
routerD#sh ip bgp
BGP table version is 59, local router ID is 200.30.40.1
Status codes: s suppressed, d damped, h history, * valid, > best,
i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop Metric LocPrf
Weight Path
* i145.1.0.0 145.1.0.199
0 100 0 i
*>
0.0.0.0
0 32768 i
*>i200.30.30.0 145.1.0.199
46226176 100 0 i
*> 200.30.40.0 0.0.0.0
46226176 32768 i
* i200.50.80.0/20 200.30.30.2
0 100 0 1000 i
*>
200.30.40.2
0
0 1000 i
routerD#show run
Building configuration...
Current configuration:
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname routerD
!
enable password san-fran
!
ip subnet-zero
no ip domain-lookup
ip host routerC 145.1.0.199 200.30.30.1
ip host routerD 145.1.0.200 200.30.40.1
ip host routerA 200.30.30.2 200.50.80.65 200.50.80.1
ip host routerB 200.30.40.2 200.50.80.97 200.50.80.2
ip host CorpRouterG 200.50.80.66 200.50.80.129
ip host CorpRouterH 200.50.80.98 200.50.80.130
ip host ISProuterE 145.1.0.201
ip host ISProuterF 145.1.0.202
!
interface Ethernet0
ip address 145.1.0.200 255.255.0.0
!
interface Serial0
ip address 200.30.40.1 255.255.255.252
bandwidth 56
clockrate 56000
!
router eigrp 2
redistribute bgp 1 metric 1000 200 255 1 1500
network 145.1.0.0
distribute-list 30 out bgp 1
!
router bgp 1
network 145.1.0.0
network 200.30.40.0
neighbor 145.1.0.199 remote-as 1
neighbor 200.30.40.2 remote-as 1000
!
no ip classless
access-list 30 permit any
!
line vty 0 4
exec-timeout 0 0
password cisco
login
!
end
Gateway of last resort is 200.50.80.65 to network 0.0.0.0
200.50.80.0/27 is subnetted, 3 subnets
C 200.50.80.128 is directly connected,
Serial1
D 200.50.80.96 [90/46251776] via
200.50.80.130, 01:07:36, Serial1
C 200.50.80.64 is directly connected,
Ethernet0
D*EX 0.0.0.0/0 [170/257049600] via 200.50.80.65, 00:11:37, Ethernet0
[170/257049600] via 200.50.80.130, 00:11:37, Serial1
CorpRouterG#sh ip bgp
% BGP not active
CorpRouterG#show run
Building configuration...
Current configuration:
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname CorpRouterG
!
enable password san-fran
!
no ip domain-lookup
ip host routerC 145.1.0.199 200.30.30.1
ip host routerD 145.1.0.200 200.30.40.1
ip host routerA 200.30.30.2 200.50.80.65 200.50.80.1
ip host routerB 200.30.40.2 200.50.80.97 200.50.80.2
ip host CorpRouterG 200.50.80.66 200.50.80.129
ip host CorpRouterH 200.50.80.98 200.50.80.130
ip host ISProuterE 145.1.0.201
ip host ISProuterF 145.1.0.202
!
interface Ethernet0
ip address 200.50.80.66 255.255.255.224
!
interface Serial1
ip address 200.50.80.129 255.255.255.224
bandwidth 56
clockrate 56000
!
router eigrp 1
network 200.50.80.0
!
no ip classless
!
line vty 0 4
exec-timeout 0 0
password cisco
login
!
end
Gateway of last resort is 200.50.80.97 to network 0.0.0.0
200.50.80.0/27 is subnetted, 3 subnets
C 200.50.80.128 is directly connected,
Serial1
C 200.50.80.96 is directly connected,
Ethernet0
D 200.50.80.64 [90/46251776] via
200.50.80.129, 01:07:58, Serial1
D*EX 0.0.0.0/0 [170/256537600] via 200.50.80.97, 00:11:58, Ethernet0
CorpRouterH#sh ip bgp
% BGP not active
CorpRouterH#show run
Building configuration...
Current configuration:
!
version 11.2
!
hostname CorpRouterH
!
enable password san-fran
!
no ip domain-lookup
ip host routerC 145.1.0.199 200.30.30.1
ip host routerD 145.1.0.200 200.30.40.1
ip host routerA 200.30.30.2 200.50.80.65 200.50.80.1
ip host routerB 200.30.40.2 200.50.80.97 200.50.80.2
ip host CorpRouterG 200.50.80.66 200.50.80.129
ip host CorpRouterH 200.50.80.98 200.50.80.130
ip host ISProuterE 145.1.0.201
ip host ISProuterF 145.1.0.202
!
interface Ethernet0
ip address 200.50.80.98 255.255.255.224
!
interface Serial1
ip address 200.50.80.130 255.255.255.224
bandwidth 56
!
router eigrp 1
network 200.50.80.0
!
no ip classless
!
line vty 0 4
exec-timeout 0 0
password cisco
login
!
end
Gateway of last resort is not set
C 145.1.0.0/16 is directly connected, Ethernet0
D 200.30.30.0/24 [90/46251776] via 145.1.0.199, 00:03:03,
Ethernet0
D 200.30.40.0/24 [90/46251776] via 145.1.0.200, 00:03:01,
Ethernet0
D EX 200.50.80.0/20 [170/2636800] via 145.1.0.199, 00:03:03, Ethernet0
[170/2636800] via 145.1.0.200, 00:03:03, Ethernet0
ISProuterE#sh ip bgp
% BGP not active
ISProuterE#sho run
Building configuration...
Current configuration:
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname ISProuterE
!
enable password san-fran
!
no ip domain-lookup
ip host routerC 145.1.0.199 200.30.30.1
ip host routerD 145.1.0.200 200.30.40.1
ip host routerA 200.30.30.2 200.50.80.65 200.50.80.1
ip host routerB 200.30.40.2 200.50.80.97 200.50.80.2
ip host CorpRouterG 200.50.80.66 200.50.80.129
ip host CorpRouterH 200.50.80.98 200.50.80.130
ip host ISProuterE 145.1.0.201
ip host ISProuterF 145.1.0.202
!
interface Ethernet0
ip address 145.1.0.201 255.255.0.0
!
router eigrp 2
network 145.1.0.0
!
no ip classless
!
line vty 0 4
exec-timeout 0 0
password cisco
login
!
end
Gateway of last resort is not set
C 145.1.0.0/16 is directly connected, Ethernet0
D 200.30.30.0/24 [90/46251776] via 145.1.0.199, 00:03:20,
Ethernet0
D 200.30.40.0/24 [90/46251776] via 145.1.0.200, 00:03:14,
Ethernet0
D EX 200.50.80.0/20 [170/2636800] via 145.1.0.199, 00:03:14, Ethernet0
[170/2636800] via 145.1.0.200, 00:03:14, Ethernet0
ISProuterF>sh ip bgp
% BGP not active
ISProuterF#sho run
Building configuration...
Current configuration:
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname ISProuterF
!
enable password san-fran
!
no ip domain-lookup
ip host routerC 145.1.0.199 200.30.30.1
ip host routerD 145.1.0.200 200.30.40.1
ip host routerA 200.30.30.2 200.50.80.65 200.50.80.1
ip host routerB 200.30.40.2 200.50.80.97 200.50.80.2
ip host CorpRouterG 200.50.80.66 200.50.80.129
ip host CorpRouterH 200.50.80.98 200.50.80.130
ip host ISProuterE 145.1.0.201
ip host ISProuterF 145.1.0.202
!
interface Ethernet0
ip address 145.1.0.202 255.255.0.0
!
router eigrp 2
network 145.1.0.0
!
no ip classless
!
line vty 0 4
exec-timeout 0 0
password cisco
login
!
end
Dr. Peter J. Welcher (CCIE #1773, CCSI #94014) is a Senior Consultant with Chesapeake NetCraftsmen. NetCraftsmen is a high-end consulting firm and Cisco Premier Partner dedicated to quality consulting and knowledge transfer. NetCraftsmen has nine CCIE's, with expertise including large network high-availability routing/switching and design, VoIP, QoS, MPLS, network management, security, IP multicast, and other areas. See http://www.netcraftsmen.net for more information about NetCraftsmen. Pete's links start at http://www.netcraftsmen.net/welcher . New articles will be posted under the Articles link. Questions, suggestions for articles, etc. can be sent to pjw@netcraftsmen.net .