To obtain more RIP routing information, you can configure RIP to import external routes. You can run commands to view the configuration results.
Networking Requirements
As shown in Figure 3-2, two RIP processes, RIP 100 and RIP 200, run on Router B. Router B exchanges routing information with Router A and Router C through RIP 100 and RIP 200 respectively.
It is required that the two RIP processes of Router B import RIP routes from each other. The cost of the routes imported from RIP 200 defaults to 3.
In addition, a filtering policy needs to be configured on Router B to filter out the route 192.168.4.0/24 imported from RIP 200 and prevent it from being advertised to Router A.
Configuration Roadmap
The configuration roadmap is as follows:
-
Enable RIP 100 and RIP 200 on each router and specify network segments.
-
Configure the two RIP processes on Router B to import routes from each other and set the default cost of the routes imported from RIP 200 to 3.
-
Configure an ACL on Router B to filter the routes imported from RIP 200.
Data Preparation
To complete the configuration, you need the following data:
-
RIP 100 and network segments (192.168.1.0 and 192.168.0.0) on Router A
-
RIP 100, RIP 200, and network segments (192.168.1.0 and 192.168.2.0) on Router B
-
RIP 200 and network segments (192.168.2.0, 192.168.3.0, and 192.168.4.0) on Router C
-
Default cost of the routes imported by Router B from RIP 200, which is 3
-
ACL 2000 that is used to deny the route with the source network segment being 192.168.4.0
Procedure
- Configure an IP address for each interface.
The configuration details are not described here.
- Configure basic RIP functions.
# Enable RIP process 100 on Router A.
[RouterA] rip 100[RouterA-rip-100] network 192.168.0.0[RouterA-rip-100] network 192.168.1.0[RouterA-rip-100] quit# Enable two RIP processes, RIP 100 and RIP 200, on Router B.
[RouterB] rip 100[RouterB-rip-100] network 192.168.1.0[RouterB-rip-100] quit[RouterB] rip 200[RouterB-rip-200] network 192.168.2.0[RouterB-rip-200] quit# Enable RIP process 200 on Router C.
[RouterC] rip 200[RouterC-rip-200] network 192.168.2.0[RouterC-rip-200] network 192.168.3.0[RouterC-rip-200] network 192.168.4.0[RouterC-rip-200] quit# Check the routing table of Router A.
[RouterA] display ip routing-tableRoute Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.0.0/24 Direct 0 0 D 192.168.0.1 GigabitEthernet2/0/0
192.168.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0 0 D 192.168.1.1 Pos1/0/0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- Configure RIP to import external routes.
# Set the default route cost of RIP 200 routes imported by RIP 100 to 3 on Router B and configure the two RIP processes to import routes from each other.
[RouterB] rip 100[RouterB-rip-100] default-cost 3[RouterB-rip-100] import-route rip 200[RouterB-rip-100] quit[RouterB] rip 200[RouterB-rip-200] import-route rip 100[RouterB-rip-200] quit# Check the routing table of Router A after the routes are imported. The routes to network segments 192.168.2.0/24, 192.168.3.0/24, and 192.168.4.0/24 are imported to RIP.
[RouterA] display ip routing-tableRoute Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.0.0/24 Direct 0 0 D 192.168.0.1 GigabitEthernet2/0/0
192.168.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0 0 D 192.168.1.1 Pos1/0/0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.2.0/24 RIP 100 4 D 192.168.1.2 Pos1/0/0
192.168.3.0/24 RIP 100 4 D 192.168.1.2 Pos1/0/0
192.168.4.0/24 RIP 100 4 D 192.168.1.2 Pos1/0/0
- Configure RIP to filter the imported routes.
# Configure an ACL on Router B and set a rule to deny the packets with the source address being 192.168.4.0/24.
[RouterB] acl 2000[RouterB-acl-basic-2000] rule deny source 192.168.4.0 0.0.0.255[RouterB-acl-basic-2000] rule permit[RouterB-acl-basic-2000] quit# Filter out the route 192.168.4.0/24 imported from RIP 200 on Router B according to the ACL rule.
[RouterB] rip 100[RouterB-rip-100] filter-policy 2000 export - Verify the configuration.
# Check the routing table of Router A after the filtering. The route to 192.168.4.0/24 does not exist in the routing table. This means that the route is filtered out.
[RouterA] display ip routing-tableRoute Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.0.0/24 Direct 0 0 D 192.168.0.1 GigabitEthernet2/0/0
192.168.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0 0 D 192.168.1.1 Pos1/0/0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.2.0/24 RIP 100 4 D 192.168.1.2 Pos1/0/0
192.168.3.0/24 RIP 100 4 D 192.168.1.2 Pos1/0/0

