步骤:
第一步:地址规划
设备 | 接口 | 地址 |
---|---|---|
R1 | G0/0/0 | 192.168. 1.1/24 |
R2 | G0/0/0 | 192.168.1.2/24 |
R2 | G0/0/1 | 192.168.2.1/24 |
R3 | G0/0/0 | 192.168.2.2/24 |
R3 | G0/0/1 | 192.168.3.1/24 |
R4 | G0/0/0 | 192.168.3.2/24 |
R4 | G0/0/1 | 192.168.4.1/24 |
R5 | G0/0/0 | 192.168.4.2/24 |
R5 | G0/0/1 | 192.168.1.3/24 |
第二步:设备配置
R1地址配置:
[R1]interface g0/0/0 [R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
R2地址配置:
[R2]interface g0/0/0 [R2-GigabitEthernet0/0/0]ip address 192.168.1.2 24 [R2]interface g0/0/1 [R2-GigabitEthernet0/0/1]ip address 192.168.2.1 24
R3地址配置:
[R3]interface g0/0/0 [R3-GigabitEthernet0/0/0]ip address 192.168.2.2 24
[R3]interface g0/0/1 [R3-GigabitEthernet0/0/1]ip address 192.168.3.1 24
R4地址配置:
[R4]interface g0/0/0 [R4-GigabitEthernet0/0/0]ip address 192.168.3.2 24 [R4]interface g0/0/1 [R4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
R5地址配置:
[R5]interface g0/0/0 [R5-GigabitEthernet0/0/0]ip address 192.168.4.2 24
[R5]interface g0/0/1 [R5-GigabitEthernet0/0/1]ip address 192.168.1.3 24
第三部:测试直连设备间通讯
R1与R2和R5间通信
<R1>ping 192.168.1.2 PING 192.168.1.2: 56 data bytes, press CTRL_C to break Reply from 192.168.1.2: bytes=56 Sequence=1 ttl=255 time=150 ms Reply from 192.168.1.2: bytes=56 Sequence=2 ttl=255 time=50 ms Reply from 192.168.1.2: bytes=56 Sequence=3 ttl=255 time=40 ms Reply from 192.168.1.2: bytes=56 Sequence=4 ttl=255 time=50 ms Reply from 192.168.1.2: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 192.168.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 40/68/150 ms
<R1>ping 192.168.1.3
PING 192.168.1.3: 56 data bytes, press CTRL_C to break Reply from 192.168.1.3: bytes=56 Sequence=1 ttl=255 time=90 ms Reply from 192.168.1.3: bytes=56 Sequence=2 ttl=255 time=50 ms Reply from 192.168.1.3: bytes=56 Sequence=3 ttl=255 time=50 ms Reply from 192.168.1.3: bytes=56 Sequence=4 ttl=255 time=60 ms Reply from 192.168.1.3: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 192.168.1.3 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 40/58/90 ms
<R2>ping 192.168.1.3 PING 192.168.1.3: 56 data bytes, press CTRL_C to break Reply from 192.168.1.3: bytes=56 Sequence=1 ttl=255 time=100 ms Reply from 192.168.1.3: bytes=56 Sequence=2 ttl=255 time=40 ms Reply from 192.168.1.3: bytes=56 Sequence=3 ttl=255 time=30 ms Reply from 192.168.1.3: bytes=56 Sequence=4 ttl=255 time=40 ms Reply from 192.168.1.3: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 192.168.1.3 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/50/100 ms
第四步:配置路由
R1配置
[R1]rip 1 [R1-rip-1]version 2 [R1-rip-1]network 192.168.1.0
R2配置
[R2]rip 1 [R2-rip-1]version 2 [R2-rip-1]network 192.168.1.0 [R2-rip-1]network 192.168.2.0
R3配置
[R3]rip 1 [R3-rip-1]version 2 [R3-rip-1]network 192.168.2.0 [R3-rip-1]network 192.168.3.0
R4配置
[R4]rip 1 [R4-rip-1]version 2 [R4-rip-1]network 192.168.3.0 [R4-rip-1]network 192.168.4.0
R5配置
[R5]rip 1 [R5-rip-1]version 2 [R5-rip-1]network 192.168.4.0 [R5-rip-1]network 192.168.1.0
第五步:查看路由表
R1路由表
[R1]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
Public routing table : RIP Destinations : 3 Routes : 4
RIP routing table status : <Active> Destinations : 3 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.2.0/24 RIP 100 1 D 192.168.1.2 GigabitEthernet
0/0/0 192.168.3.0/24 RIP 100 2 D 192.168.1.2 GigabitEthernet 0/0/0 RIP 100 2 D 192.168.1.3 GigabitEthernet 0/0/0 192.168.4.0/24 RIP 100 1 D 192.168.1.3 GigabitEthernet 0/0/0
RIP routing table status : <Inactive> Destinations : 0 Routes : 0
R2路由表
[R2]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
Public routing table : RIP Destinations : 2 Routes : 2
RIP routing table status : <Active> Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.3.0/24 RIP 100 1 D 192.168.2.2 GigabitEthernet
0/0/1 192.168.4.0/24 RIP 100 1 D 192.168.1.3 GigabitEthernet 0/0/0
RIP routing table status : <Inactive> Destinations : 0 Routes : 0
其他省略
第六步:测试连通性
R1和R4之间的连通性测试
[R1]ping 192.168.3.2 PING 192.168.3.2: 56 data bytes, press CTRL_C to break Request time out Request time out Reply from 192.168.3.2: bytes=56 Sequence=3 ttl=254 time=90 ms Reply from 192.168.3.2: bytes=56 Sequence=4 ttl=254 time=50 ms Reply from 192.168.3.2: bytes=56 Sequence=5 ttl=254 time=40 ms
--- 192.168.3.2 ping statistics --- 5 packet(s) transmitted 3 packet(s) received 40.00% packet loss round-trip min/avg/max = 40/60/90 ms