三个路由器分别连接三台电脑,路由器不同接口对应不同的网段,值得注意的是,两电脑间连接尚且属于一个网段,由此路由器间另属一个网段。所以共有5个网段。
设计规定拓扑图中,各自的ip和端口
1:192.168.1.0/24
2:192.168.2.0/24
3:192.168.3.0/24
4:192.168.4.0/24
5:192.168.5.0/24
路由器R2:
[Huawei]sysn
[Huawei]sysname r1
[r1]sysname r2
[r2]interface Ethernet0/0/0
[r2-Ethernet0/0/0]ip address 192.168.1.1 24
[r2-Ethernet0/0/0]q
[r2]display ip routing-table
[r2]ip route-static 192.168.3.0 255.255.255.0 192.168.2.2
[r2]ip route-static 192.168.5.0 255.255.255.0 192.168.4.2
路由器R3:
[Huawei]sysn
[Huawei]sysname r3
[r3]sysname r3
[r3]interface Ethernet0/0/0
[r3-Ethernet0/0/0]ip address 192.168.3.1 24
[r3-Ethernet0/0/0]ip address 192.168.2.2 24
[r3-Ethernet0/0/0]q
[r3]display ip routing-table
[r3]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1
[r3]ip route-static 192.168.5.0 255.255.255.0 192.168.4.2
路由器R4:
[Huawei]sysn
[Huawei]sysname r4
[r4]sysname r4
[r4]interface Ethernet0/0/0
[r4-Ethernet0/0/1]ip address 192.168.5.1 24
[r4-Ethernet0/0/0]ip address 192.168.4.2 24
[r4-Ethernet0/0/0]q
[r4]display ip routing-table
[r4]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1
[r4]ip route-static 192.168.3.0 255.255.255.0 192.168.4.1
PC1 PC2 PC3 分别对应