Example for Configuring Basic RIP Functions
Networking Requirements
As shown in Figure 3-9, RouterA, RouterB, RouterC, and RouterD are located on a 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 IP address for each interface to ensure network reachability.
Enable RIP on each router to implement network connections between processes.
Configure RIP-2 on each router to improve RIP performance.
Procedure
- Configure IP address for each interface.
# Configure Router A.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 192.168.1.1 24
The configurations of Router B, Router C, and Router D are similar to the configuration of Router A, and are not mentioned here.
- Configure basic RIP functions.
# Configure Router A.
[RouterA] rip [RouterA-rip-1] network 192.168.1.0 [RouterA-rip-1] quit
# Configure Router B.
[RouterB] rip [RouterB-rip-1] network 192.168.1.0 [RouterB-rip-1] network 172.16.0.0 [RouterB-rip-1] network 10.0.0.0 [RouterB-rip-1] quit
# Configure Router C.
[RouterC] rip [RouterC-rip-1] network 172.16.0.0 [RouterC-rip-1] quit
# Configure Router D.
[RouterD] rip [RouterD-rip-1] network 10.0.0.0 [RouterD-rip-1] quit
# Check the RIP routing table of Router A.
[RouterA] display rip 1 route
Route Flags: R - RIP
A - Aging, S - Suppressed, G - Garbage-collect
-------------------------------------------------------------------------
Peer 192.168.1.2 on GigabitEthernet1/0/0
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
The preceding display shows that the routes advertised by RIPv1 carry natural masks.
- Configure the RIP version.
# Configure RIPv2 on Router A.
[RouterA] rip [RouterA-rip-1] version 2 [RouterA-rip-1] quit
# Configure RIPv2 on Router B.
[RouterB] rip [RouterB-rip-1] version 2 [RouterB-rip-1] quit
# Configure RIPv2 on Router C.
[RouterC] rip [RouterC-rip-1] version 2 [RouterC-rip-1] quit
# Configure RIPv2 on Router D.
[RouterD] rip [RouterD-rip-1] version 2 [RouterD-rip-1] quit
- Verify the configuration.
# Check the RIP routing table of Router A.
[RouterA] display rip 1 route
Route Flags: R - RIP
A - Aging, S - Suppressed, G - Garbage-collect
-------------------------------------------------------------------------
Peer 192.168.1.2 on GigabitEthernet1/0/0
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 preceding display shows that the routes advertised by RIPv2 carry subnet masks.
Configuration Files
Configuration file of Router A
# sysname RouterA # interface GigabitEthernet1/0/0 ip address 192.168.1.1 255.255.255.0 # rip 1 version 2 network 192.168.1.0 # return
Configuration file of Router B
# sysname RouterB # interface GigabitEthernet1/0/0 ip address 192.168.1.2 255.255.255.0 # interface GigabitEthernet2/0/0 ip address 172.16.1.1 255.255.255.0 # interface GigabitEthernet3/0/0 ip address 10.1.1.1 255.255.255.0 # rip 1 version 2 network 192.168.1.0 network 172.16.0.0 network 10.0.0.0 # return
Configuration file of Router C
# sysname RouterC # interface GigabitEthernet2/0/0 ip address 172.16.1.2 255.255.255.0 # rip 1 version 2 network 172.16.0.0 # return
Configuration file of Router D
# sysname RouterD # interface GigabitEthernet1/0/0 ip address 10.1.1.2 255.255.255.0 # rip 1 version 2 network 10.0.0.0 # return