Example for Configuring Basic RIP Functions
Networking Requirements
As shown in Figure 3-9, SwitchA, SwitchB, SwitchC, and SwitchD are located on a small-sized network, and they need to communicate with each other.
Configuration Roadmap
The network size is small, so RIP-2 is recommended. The configuration roadmap is as follows:
Configure a VLAN and an IP address for each interface to ensure network reachability.
Enable RIP on each switch to implement network connections between processes.
Configure RIP-2 on each switch to improve RIP performance.
Procedure
- Name the device. The configuration procedure is not provided here.
- Configure a VLAN and an IP address for each interface. The configuration procedure is not provided here.
- Specify the network segment where RIP needs to be enabled.
# Configure SwitchA.
[~SwitchA] rip
[*SwitchA-rip-1] network 192.168.1.0
[*SwitchA-rip-1] commit
[~SwitchA-rip-1] quit
# Configure SwitchB.
[~SwitchB] rip
[*SwitchB-rip-1] network 192.168.1.0
[*SwitchB-rip-1] network 172.16.0.0
[*SwitchB-rip-1] network 10.0.0.0
[*SwitchB-rip-1] commit
[~SwitchB-rip-1] quit
# Configure SwitchC.
[~SwitchC] rip
[*SwitchC-rip-1] network 172.16.0.0
[*SwitchC-rip-1] commit
[~SwitchC-rip-1] quit
# Configure SwitchD.
[~SwitchD] rip
[*SwitchD-rip-1] network 10.0.0.0
[*SwitchD-rip-1] commit
[~SwitchD-rip-1] quit
# Display the RIP routing table of SwitchA.
[~SwitchA] display rip 1 route
Route Flags: R - RIP
A - Aging, S - Suppressed, G - Garbage-collect
-------------------------------------------------------------------------
Peer 192.168.1.2 on Vlanif10
Destination/Mask Nexthop Cost Tag Flags Sec
10.0.0.0/8 192.168.1.2 1 0 RA 14
172.16.0.0/16 192.168.1.2 1 0 RA 14
From the routing table, you can find that the routes advertised by RIP-1 use natural masks.
- Specify the RIP version.
# Configure RIP-2 on SwitchA.
[~SwitchA] rip
[*SwitchA-rip-1] version 2
[*SwitchA-rip-1] commit
[~SwitchA-rip-1] quit
# Configure RIP-2 on SwitchB.
[~SwitchB] rip
[*SwitchB-rip-1] version 2
[*SwitchB-rip-1] commit
[~SwitchB-rip-1] quit
# Configure RIP-2 on SwitchC.
[~SwitchC] rip
[*SwitchC-rip-1] version 2
[*SwitchC-rip-1] commit
[~SwitchC-rip-1] quit
# Configure RIP-2 on SwitchD.
[~SwitchD] rip
[*SwitchD-rip-1] version 2
[*SwitchD-rip-1] commit
[~SwitchD-rip-1] quit
- Verify the configuration.
# Display the RIP routing table of SwitchA.
[~SwitchA] display rip 1 route
Route Flags: R - RIP
A - Aging, S - Suppressed, G - Garbage-collect
-------------------------------------------------------------------------
Peer 192.168.1.2 on Vlanif10
Destination/Mask Nexthop Cost Tag Flags Sec
10.1.1.0/24 192.168.1.2 1 0 RA 32
172.16.1.0/24 192.168.1.2 1 0 RA 32
The RIP routing table shows that the routes advertised by RIP-2 contain accurate subnet masks.
Configuration Files
# Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 10
#
interface Vlanif 10
ip address 192.168.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
rip 1
version 2
network 192.168.1.0
#
return
# Configuration file of SwitchB
#
sysname SwitchB
#
vlan batch 10 20 30
#
interface Vlanif 10
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif 20
ip address 172.16.1.1 255.255.255.0
#
interface Vlanif 30
ip address 10.1.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 30
#
rip 1
version 2
network 10.0.0.0
network 172.16.0.0
network 192.168.1.0
#
return
# Configuration file of SwitchC
#
sysname SwitchC
#
vlan batch 20
#
interface Vlanif 20
ip address 172.16.1.2 255.255.255.0
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
rip 1
version 2
network 172.16.0.0
#
return
# Configuration file of SwitchD
#
sysname SwitchD
#
vlan batch 30
#
interface Vlanif 30
ip address 10.1.1.2 255.255.255.0
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
rip 1
version 2
network 10.0.0.0
#
return