< Free Open Study > |
5-2 distance admin-distance ip-source-address ip-address-mask ip-access-list-numberSyntax Description:
Purpose: To modify the administrative distance of BGP routes. When a particular route is learned via multiple routing protocols, the administrative distance is used to select the best route. The lower administrative distance is preferred. The administrative distances used for the IP routing protocols are as follows :
Cisco IOS Software Release: 10.0 Configuration Example 1: Modifying the Distance of All Routes Received from a Particular NeighborIn Figure 5-1, Router A is advertising 144.223.1.0/24 and 144.223.2.0/24 via EBGP, and Router C is advertising 205.40.30.0/24 via IBGP. Figure 5-1. Default Administrative Distance for EBGP and IBGP
Router A interface loopback 0 ip address 144.223.1.1 255.255.255.0 ! interface loopback 1 ip address 144.223.2.1 255.255.255.0 ! router bgp 1 network 144.223.1.0 mask 255.255.255.0 network 144.223.2.0 mask 255.255.255.0 neighbor 172.17.1.1 remote-as 2 ___________________________________________________________________________ Router B router bgp 2 no synchronization neighbor 172.17.1.2 remote-as 1 neighbor 10.1.1.2 remote-as 2 ___________________________________________________________________________ Router C interface loopback 0 ip address 205.40.30.1 255.255.255.0 ! router bgp 2 network 205.40.30.0 neighbor 10.1.1.1 remote-as 2 The default administrative distance is 20 for EBGP and 200 for IBGP. This can be verified by inspecting the IP routing table on Router B: rtrB# show ip route bgp 144.223.0.0/24 is subnetted, 2 subnets B 144.223.2.0 [20/0] via 172.17.1.2, 00:00:51 B 144.223.1.0 [20/0] via 172.17.1.2, 01:13:14 B 205.40.30.0/24 [200/0] via 10.1.1.2, 01:13:14 For this example, we will set the administrative distance to 50 for all routes received by Router B from Router C. Using the first form of the command, all we need to do is use the IP address of Router C. Modify the BGP configuration on Router B as shown: Router B router bgp 2 no synchronization neighbor 172.17.1.2 remote-as 1 neighbor 10.1.1.2 remote-as 2 distance 50 10.1.1.2 0.0.0.0 Using a mask of 0.0.0.0 matches all 32 bits of the IP address. Multiple addresses can be matched using a different mask. For example, using 10.1.1.0 0.0.0.255 matches all neighbors on subnet 10.1.1.0/24. To match all neighbors, use the address/mask pair 0.0.0.0 255.255.255.255. VerificationVerify that the administrative distance of the route learned from Router C has been set to 50: rtrB# show ip route bgp 144.223.0.0/24 is subnetted, 2 subnets B 144.223.2.0 [20/0] via 172.17.1.2, 00:00:51 B 144.223.1.0 [20/0] via 172.17.1.2, 01:13:14 B 205.40.30.0/24 [50/0] via 10.1.1.2, 01:13:14 Configuration Example 2: Modifying the Distance of a Specific Route Received from a Particular NeighborFor the configuration in Figure 5-1, we will set the administrative distance to 80 for the 144.223.1.0/24 route being advertised by Router A. Modify the BGP configuration on Router B as shown: router bgp 2 no synchronization neighbor 172.17.1.1 remote-as 1 neighbor 10.1.1.2 remote-as 2 distance 50 10.1.1.2 0.0.0.0 distance 80 172.17.1.0 0.0.0.255 1 ! access-list 1 permit 144.223.1.0 0.0.0.255 VerificationVerify that the 144.223.1.0 route now has an administrative distance of 80 and that the administrative distance for the 144.223.2.0 route is unchanged: rtrB# show ip route bgp 144.223.0.0/24 is subnetted, 2 subnets B 144.223.2.0 [20/0] via 172.17.1.2, 00:02:22 B 144.223.1.0 [80/0] via 172.17.1.2, 00:02:22 B 205.40.30.0/24 [50/0] via 10.1.1.2, 00:02:22 Troubleshooting
|
< Free Open Study > |