Hà Nội: NTT03, Line 1, Thống Nhất Complex, 82 Nguyễn Tuân, Thanh Xuân, Hà Nội. ● HCM: Số 31B, Đường 1, Phường An Phú, Quận 2 (Thủ Đức), TP HCM. ===> Đơn Vị Hàng Đầu Trong Lĩnh Vực Cung Cấp Thiết Bị Security - Network - Wifi - CCTV - Conference - Máy chủ Server - Lưu trữ Storge.
Danh mục sản phẩm

Configure RIP Route Filtration

Network Requirements

  • RIPv2 runs between Device1 and Device2 for route interaction.
  • Device1 learns two routes 2.0.0.0/24 and 3.0.0.0/24 that have been advertised by Device2, and then it filters route 3.0.0.0/24 in the advertisement direction of Device2.

Network Topology

Networking for Configuring RIP Route Filtration

Figure 5-4 Networking for Configuring RIP Route Filtration

Configuration Steps

Step 1: Create VLANs, and add ports to the required VLANs. (Omitted)

Step 2: Configure IP addresses for the ports. (Omitted)

Step 3: Configure RIP.

#Configure Device1.

Device1#configure terminal
Device1(config)#router rip
Device1(config-rip)#version 2
Device1(config-rip)#network 1.0.0.0
Device1(config-rip)#exit

#Configure Device2.

Device2#configure terminal
Device2(config)#router rip
Device2(config-rip)#version 2
Device2(config-rip)#network 1.0.0.0
Device2(config-rip)#network 2.0.0.0
Device2(config-rip)#network 3.0.0.0
Device2(config-rip)#exit

#Query the routing table of Device1.

Device1#show ip route 
Codes: C - Connected, L - Local, S - static, R - RIP, B - BGP, i-ISIS 
       U - Per-user Static route 
       O - OSPF, OE-OSPF External, M - Management, E - IRMP, EX - IRMP external 
 
C 1.0.0.0/24 is directly connected, 00:23:06, vlan2 
R 2.0.0.0/24 [120/1] via 1.0.0.2, 00:13:26, vlan2
R 3.0.0.0/24 [120/1] via 1.0.0.2, 00:13:26, vlan2
C 127.0.0.0/8 is directly connected, 76:51:00, lo0 

According to the routing table, Device1 has learnt two routes advertised by Device2.

Step 4: Configure the ACL.

#Configure Device2.

Device2(config)#ip access-list standard 1
Device2(config-std-nacl)#permit 2.0.0.0 0.0.0.255
Device2(config-std-nacl)#commit
Device2(config-std-nacl)#exit

note


  • In configuring route filtration, you can create a filtration rule based on a prefix list or ACL. The prefix list can precisely match routing masks while the ACL cannot match routing masks.

Step 5: Configure route filtration.

#Configure route filtration in the output direction of interface VLAN2 of Device2.

Device2(config)#router rip
Device2(config-rip)#distribute-list 1 out vlan2
Device2(config-rip)#exit

Step 6: Check the result.

#Query the routing table of Device1.

Device1#show ip route 
Codes: C - Connected, L - Local, S - static, R - RIP, B - BGP, i-ISIS 
       U - Per-user Static route 
       O - OSPF, OE-OSPF External, M - Management, E - IRMP, EX - IRMP external 
 
C 1.0.0.0/24 is directly connected, 00:23:06, vlan2 
R 2.0.0.0/24 [120/1] via 1.0.0.2, 00:13:26, vlan2
C 127.0.0.0/8 is directly connected, 76:51:00, lo0 

According to the routing table, Device2 does not advertise route 3.0.0.0/24 to Device1, but the route is deleted from the routing table of Device only after the route times out.

note


  • The distribute-list can be applied to all interfaces or a specified interface, and it can be used in both the receive and advertisement directions.