Pages

Wednesday, April 6, 2011

Distribute-list gateway

"distribute-list gateway" is the command that allows us to permit or deny routing update based on source of the updates.

Example Configuration


We have R1, R2 and R3 in the RIP routing domain.  However, we want to receive the routing updates from R3 only. Here is the configuration example to accomplish this.


R2

router rip
 network 2.0.0.0
 network 192.168.1.0
 network 192.168.2.0
 distribute-list gateway R3-ONLY in
 no auto-summary
!
!
ip prefix-list R3-ONLY seq 5 permit 192.168.2.2/32


R2 Routing table

Before putting in the command
R2#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

R    1.0.0.0/8 [120/1] via 192.168.1.1, 00:00:02, FastEthernet0/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
R    3.0.0.0/8 [120/1] via 192.168.2.2, 00:00:14, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
R2#


After distribute-list gateway command 

R2#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

     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
R    3.0.0.0/8 [120/1] via 192.168.2.2, 00:00:15, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1

Note: After we put in the command, the network 1.1.1.0/24 disappeared.


No comments:

Post a Comment