Perform this task to configure your network to access one of two connections to a single ISP, where one of the connections is the preferred route and the second connection is a backup route. In the figure above Router E in autonomous system 50000 has two BGP peers in a single autonomous system, autonomous system 45000. Using this task, autonomous system 50000 does not learn any routes from autonomous system 45000 and is sending its own routes using BGP. This task is configured at Router E in the figure above and covers three features about multihoming to a single ISP:
-
Outbound traffic--Router E will forward default routes and traffic to autonomous system 45000 with Router B as the primary link and Router D as the backup link. Static routes are configured to both Router B and Router D with a lower distance configured for the link to Router B.
-
Inbound traffic--Inbound traffic from autonomous system 45000 is configured to be sent from Router B unless the link fails when the backup route is to send traffic from Router D. To achieve this, outbound filters are set using the MED metric.
-
Prevention of transit traffic--A route map is configured at Router E in autonomous system 50000 to block all incoming BGP routing updates to prevent autonomous system 50000 from receiving transit traffic from the ISP in autonomous system 45000.
SUMMARY STEPS
1. enable
2. configure terminal
3. router bgp autonomous-system-number
4. neighbor {ip-address | peer-group-name} remote-as autonomous-system-number
5. address-family ipv4 [unicast | multicast| vrf vrf-name]
6. network network-number [mask network-mask][route-map route-map-name]
7. neighbor {ip-address | peer-group-name} route-map map-name{in | out}
8. Repeat Step 7 to apply another route map to the neighbor specified in Step 7.
9. exit
10. neighbor {ip-address | peer-group-name} remote-as autonomous-system-number
11. address-family ipv4 [unicast | multicast| vrf vrf-name]
12. neighbor {ip-address | peer-group-name} route-map map-name{in | out}
13. Repeat Step 10 to apply another route map to the neighbor specified in Step 10.
14. exit
15. exit
16. ip route prefix mask {ip-address | interface-type interface-number[ip-address]} [distance] [name][permanent| track number][tag tag]
17. Repeat Step 14 to establish another static route.
18. route-map map-name [permit| deny][sequence-number]
19. set metric value
20. exit
21. route-map map-name [permit| deny][sequence-number]
22. set metric value
23. exit
24. route-map map-name [permit| deny][sequence-number]
25. end
26. show ip route [ip-address] [mask] [longer-prefixes]
27. show ip bgp [network] [network-mask]
DETAILED STEPS
|
Command or Action |
Purpose |
|
enable
Example:
Router> enable
|
Enables privileged EXEC mode.
-
Enter your password if prompted.
|
|
configure terminal
Example:
Router# configure terminal
|
Enters global configuration mode. |
|
router bgp autonomous-system-number
Example:
Router(config)# router bgp 45000
|
Enters router configuration mode for the specified routing process. |
|
neighbor {ip-address | peer-group-name} remote-as autonomous-system-number
Example:
Router(config-router)# neighbor 192.168.2.1 remote-as 45000
|
Adds the IP address or peer group name of the neighbor in the specified autonomous system to the IPv4 multiprotocol BGP neighbor table of the local router.
-
In this example, the BGP peer at Router D is added to the BGP routing table.
|
|
address-family ipv4 [unicast | multicast| vrf vrf-name]
Example:
Router(config-router)# address-family ipv4 unicast
|
Specifies the IPv4 address family and enters address family configuration mode.
-
The unicast keyword specifies the IPv4 unicast address family. By default, the router is placed in address family configuration mode for the IPv4 unicast address family if the unicast keyword is not specified with the address-family ipv4 command.
-
The multicast keyword specifies IPv4 multicast address prefixes.
-
The vrf keyword and vrf-name argument specify the name of the VRF instance to associate with subsequent IPv4 address family configuration mode commands.
|
|
network network-number [mask network-mask][route-map route-map-name]
Example:
Router(config-router-af)# network 10.2.2.0 mask 255.255.255.0
|
Specifies a network as local to this autonomous system and adds it to the BGP routing table.
-
For exterior protocols the network command controls which networks are advertised. Interior protocols use the network command to determine where to send updates.
|
|
neighbor {ip-address | peer-group-name} route-map map-name{in | out}
Example:
Router(config-router-af)# neighbor 192.168.2.1 route-map BLOCK in
Example:
Router(config-router-af)# neighbor 192.168.2.1 route-map SETMETRIC1 out
|
Applies a route map to incoming or outgoing routes.
-
In the first example, the route map named BLOCK is applied to inbound routes at Router E.
-
In the second example, the route map named SETMETRIC1 is applied to outbound routes to Router D.
Note |
Two examples are shown here because the task example requires both these statements to be configured. |
|
|
Repeat Step 7 to apply another route map to the neighbor specified in Step 7.
|
-- |
|
exit
Example:
Router(config-router-af)# exit
|
Exits address family configuration mode and enters router configuration mode. |
|
neighbor {ip-address | peer-group-name} remote-as autonomous-system-number
Example:
Router(config-router)# neighbor 192.168.3.1 remote-as 45000
|
Adds the IP address or peer group name of the neighbor in the specified autonomous system to the IPv4 multiprotocol BGP neighbor table of the local router.
-
In this example, the BGP peer at Router D is added to the BGP routing table.
|
|
address-family ipv4 [unicast | multicast| vrf vrf-name]
Example:
Router(config-router)# address-family ipv4 unicast
|
Specifies the IPv4 address family and enters address family configuration mode.
-
The unicast keyword specifies the IPv4 unicast address family. By default, the router is placed in address family configuration mode for the IPv4 unicast address family if the unicast keyword is not specified with the address-family ipv4 command.
-
The multicast keyword specifies IPv4 multicast address prefixes.
The vrf keyword and vrf-name argument specify the name of the VRF instance to associate with subsequent IPv4 address family configuration mode commands. |
|
neighbor {ip-address | peer-group-name} route-map map-name{in | out}
Example:
Router(config-router-af)# neighbor 192.168.3.1 route-map BLOCK in
Example:
Router(config-router-af)# neighbor 192.168.3.1 route-map SETMETRIC2 out
|
Applies a route map to incoming or outgoing routes.
-
In the first example, the route map named BLOCK is applied to inbound routes at Router E.
-
In the second example, the route map named SETMETRIC2 is applied to outbound routes to Router D.
Note |
Two examples are shown here because the task example requires both these statements to be configured. |
|
|
Repeat Step 10 to apply another route map to the neighbor specified in Step 10.
|
-- |
|
exit
Example:
Router(config-router-af)# exit
|
Exits address family configuration mode and enters router configuration mode. |
|
exit
Example:
Router(config-router)# exit
|
Exits router configuration mode and enters global configuration mode. |
|
ip route prefix mask {ip-address | interface-type interface-number[ip-address]} [distance] [name][permanent| track number][tag tag]
Example:
Router(config)# ip route 0.0.0.0 0.0.0.0 192.168.2.1 50
Example:
Router(config)# ip route 0.0.0.0 0.0.0.0 192.168.2.1 50
Example:
and
Example:
Router(config)# ip route 0.0.0.0 0.0.0.0 192.168.3.1 40
|
Establishes a static route.
-
In the first example, a static route to BGP peer 192.168.2.1 is established and given an administrative distance of 50.
-
In the second example, a static route to BGP peer 192.168.3.1 is established and given an administrative distance of 40. The lower administrative distance makes this route via Router B the preferred route.
Note |
Two examples are shown here because the task example requires both these statements to be configured. |
|
|
Repeat Step 14 to establish another static route.
|
-- |
|
route-map map-name [permit| deny][sequence-number]
Example:
Router(config)# route-map SETMETRIC1 permit 10
|
Configures a route map and enters route map configuration mode.
-
In this example, a route map named SETMETRIC1 is created.
|
|
set metric value
Example:
Router(config-route-map)# set metric 100
|
Sets the MED metric value. |
|
exit
Example:
Router(config-route-map)# exit
|
Exits route map configuration mode and enters global configuration mode. |
|
route-map map-name [permit| deny][sequence-number]
Example:
Router(config)# route-map SETMETRIC2 permit 10
|
Configures a route map and enters route map configuration mode.
-
In this example, a route map named SETMETRIC2 is created.
|
|
set metric value
Example:
Router(config-route-map)# set metric 50
|
Sets the MED metric value. |
|
exit
Example:
Router(config-route-map)# exit
|
Exits route map configuration mode and enters global configuration mode. |
|
route-map map-name [permit| deny][sequence-number]
Example:
Router(config)# route-map BLOCK deny 10
|
Configures a route map and enters route map configuration mode.
-
In this example, a route map named BLOCK is created to block all incoming routes from autonomous system 45000.
|
|
end
Example:
Router(config-route-map)# end
|
Exits route map configuration mode and enters privileged EXEC mode. |
|
show ip route [ip-address] [mask] [longer-prefixes]
Example:
Router# show ip route
|
(Optional) Displays route information from the routing tables.
-
Use this command at Router E in the figure above after Router B and Router D have received update information containing the MED metric from Router E.
-
Only the syntax applicable to this task is used in this example. For more details, see the Cisco IOS IP Routing: BGP Command Reference.
|
|
show ip bgp [network] [network-mask]
Example:
Router# show ip bgp 172.17.1.0 255.255.255.0
|
(Optional) Displays the entries in the BGP routing table.
-
Use this command at Router E in the figure above after Router B and Router D have received update information containing the MED metric from Router E.
-
Only the syntax applicable to this task is used in this example. For more details, see the Cisco IOS IP Routing: BGP Command Reference.
|
Examples
The following example shows output from the show ip route command entered at Router E after this task has been configured and Router B and Router D have received update information containing the MED metric. Note that the gateway of last resort is set as 192.168.3.1, which is the route to Router B.
Router# 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 192.168.3.1 to network 0.0.0.0
10.0.0.0/24 is subnetted, 1 subnets
C 10.2.2.0 is directly connected, Ethernet0/0
C 192.168.2.0/24 is directly connected, Serial3/0
C 192.168.3.0/24 is directly connected, Serial2/0
S* 0.0.0.0/0 [40/0] via 192.168.3.1
The following example shows output from the show ip bgp command entered at Router E after this task has been configured and Router B and Router D have received routing updates. The route map BLOCK has denied all routes coming in from autonomous system 45000 so the only network shown is the local network.
Router# show ip bgp
BGP table version is 2, local router ID is 10.2.2.99
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.2.2.0/24 0.0.0.0 0 32768 i
The following example shows output from the show ip bgp command entered at Router B after this task has been configured at Router E and Router B has received routing updates. Note the metric of 50 for network 10.2.2.0.
Router# show ip bgp
BGP table version is 7, local router ID is 172.17.1.99
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.1.1.0/24 192.168.1.2 0 0 40000 i
*> 10.2.2.0/24 192.168.3.2 50 0 50000 i
*> 172.16.1.0/24 0.0.0.0 0 32768 i
*> 172.17.1.0/24 0.0.0.0 0 32768 i
The following example shows output from the show ip bgp command entered at Router D after this task has been configured at Router E and Router D has received routing updates. Note the metric of 100 for network 10.2.2.0.
Router# show ip bgp
BGP table version is 3, local router ID is 192.168.2.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.2.2.0/24 192.168.2.2 100 0 50000 i
*> 172.16.1.0/24 0.0.0.0 0 32768 i