在小型網絡中有 4 台路由器,要求在 RouterA、RouterB、RouterC 和 RouterD 上實現網絡互連。
1、拓撲圖
2、配置思路
配置思路由於要在小型網絡中實現設備的網絡互連,所以推薦配置 RIP-2 路由協議。
1. 配置各接口 IP 地址,使網絡可達。
2. 在各路由器上使能 RIP,基本實現網絡互連。
3. 在各路由器上配置 RIP-2 版本,提升 RIP 路由擴展性能。
1、 配置各接口 IP 地址,使網絡可達。
A
[Huawei]sysname A [A]int g0/0/0 [A-GigabitEthernet0/0/0]ip add 192.168.1.1 24 [A-GigabitEthernet0/0/0]quit
B
[Huawei]sysname B [B]int g0/0/0 [B-GigabitEthernet0/0/0]ip add 192.168.1.2 24 [B-GigabitEthernet0/0/0]quit [B]int g0/0/2 [B-GigabitEthernet0/0/2]ip add 172.16.1.2 24 [B-GigabitEthernet0/0/2]quit [B]int g0/0/1 [B-GigabitEthernet0/0/1]ip add 10.1.1.2 24 [B-GigabitEthernet0/0/1]quit
C
[Huawei]sysname C [C]int g0/0/2 [C-GigabitEthernet0/0/2]ip add 172.16.1.1 24 [C-GigabitEthernet0/0/2]quit
D
[Huawei]sysname D [D]int g0/0/1 [D-GigabitEthernet0/0/1]ip add 10.1.1.1 24 [D-GigabitEthernet0/0/1]quit
2. 在各路由器上使能 RIP,基本實現網絡互連。
A
[A]rip [A-rip-1]network 192.168.1.0 [A-rip-1]quit
B
[B]rip [B-rip-1]network 192.168.1.0 [B-rip-1]network 172.16.0.0 [B-rip-1]network 10.0.0.0 [B-rip-1]quit
C
[C]rip [C-rip-1]network 172.16.0.0 [C-rip-1]quit
D
[D]rip [D-rip-1]network 10.0.0.0 [D-rip-1]quit
查看路由器A的rip路由表
從路由表中可以看出,RIP-1 發布的路由信息使用的是自然掩碼。
[A]dis rip 1 route Route Flags : R - RIP A - Aging, G - Garbage-collect ---------------------------------------------------------------------------- Peer 192.168.1.2 on GigabitEthernet0/0/0 Destination/Mask Nexthop Cost Tag Flags Sec 172.16.0.0/16 192.168.1.2 1 0 RA 6 10.0.0.0/8 192.168.1.2 1 0 RA 6 [A]
3. 在各路由器上配置 RIP-2 版本,提升 RIP 路由擴展性能。
A
[A]rip [A-rip-1]version 2 [A-rip-1]quit
其它路由器與A相同。
查看路由器A的rip路由表
從路由表中可以看出,RIP-2 發布的路由中帶有更為精確的子網掩碼信息。
[A]dis rip 1 route Route Flags : R - RIP A - Aging, G - Garbage-collect ---------------------------------------------------------------------------- Peer 192.168.1.2 on GigabitEthernet0/0/0 Destination/Mask Nexthop Cost Tag Flags Sec 172.16.1.0/24 192.168.1.2 1 0 RA 31 10.1.1.0/24 192.168.1.2 1 0 RA 31 [A]
聯通性測試(路由器A ping路由器C和D)
[A]ping 172.16.1.1 PING 172.16.1.1: 56 data bytes, press CTRL_C to break Reply from 172.16.1.1: bytes=56 Sequence=1 ttl=254 time=30 ms Reply from 172.16.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms Reply from 172.16.1.1: bytes=56 Sequence=3 ttl=254 time=30 ms Reply from 172.16.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms Reply from 172.16.1.1: bytes=56 Sequence=5 ttl=254 time=40 ms --- 172.16.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/32/40 ms [A]ping 10.1.1.1 PING 10.1.1.1: 56 data bytes, press CTRL_C to break Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=254 time=40 ms Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=254 time=40 ms Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=254 time=20 ms --- 10.1.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 20/30/40 ms [A]
讀書和健身總有一個在路上