在192.168.0.0 24网段中,目标:实现全网可达
实施步骤前先划分网段,该图中共有6个广播域,子网掩码是24,则网络位需要向主机位借三位(共八位)来分出6个网段,我的选择如图右上
划分完网段后,可以提前将想要预设的接口IP分好,便于分配IP时记录
步骤一
给路由器和PC更换名字和主机名,便于区分路由
以AR1为例子
进入系统视图
<Huawei>sys
在系统视图下实现如下命令
[Huawei]sys
[Huawei]sysname r1
[r1]
步骤二
给各个设备接口配置IP
路由器配置IP以AR1为例子
由图可知AR1有三个接口:0/0/0 0/0/1 0/0/2
每个接口的IP分配命令如下
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/2]ip address 192.168.0.33 27
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/2]ip address 192.168.0.65 27
[r1]interface GigabitEthernet 0/0/2
[r1-GigabitEthernet0/0/2]ip address 192.168.0.129 27
然后退出接口视图,检查接口IP配置情况:
命令及效果图如下:
[r1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.0.33/27 up up
GigabitEthernet0/0/1 192.168.0.65/27 up up
GigabitEthernet0/0/2 192.168.0.129/27 up up
NULL0 unassigned up up(s)
给PC配置IP、子网掩码以及网关地址
步骤三
手动配置每一个ARP的未知网段和下一跳地址
ARP1配置
命令如下
[r1]ip route-static 192.168.0.96 27 192.168.0.66
[r1]ip route-static 192.168.0.160 27 192.168.0.130
[r1]ip route-static 192.168.0.192 27 192.168.0.66
[r1]ip route-static 192.168.0.192 27 192.168.0.130
查看ARP1路由表命令以及效果截图如下
看到4个static说明ARP1路由器上未知网段和下一跳的IP地址已经分配成功
ARP2配置
命令如下
[r2]ip route-static 192.168.0.32 27 192.168.0.65
[r2]ip route-static 192.168.0.128 27 192.168.0.65
[r2]ip route-static 192.168.0.160 27 192.168.0.98
[r2]ip route-static 192.168.0.192 27 192.168.0.98
查看ARP2路由表效果截图
PS:如果只查看未知网段以及下一跳的IP路由表的话可以使用如下命令
[r2]display ip routing-table protocol static
ARP3配置
命令如下
[r3]ip route-static 192.168.0.32 27 192.168.0.129
[r3]ip route-static 192.168.0.64 27 192.168.0.129
[r3]ip route-static 192.168.0.96 27 192.168.0.162
[r3]ip route-static 192.168.0.192 27 192.168.0.162
查看ARP3路由表效果截图
ARP4配置
命令如下
[r4]ip route-static 192.168.0.32 27 192.168.0.97
[r4]ip route-static 192.168.0.32 27 192.168.0.161
[r4]ip route-static 192.168.0.64 27 192.168.0.97
[r4]ip route-static 192.168.0.128 27 192.168.0.161
查看ARP4效果截图
步骤四
检测是否全网可达
PC1 ping PC2
PC2 ping PC1
ARP2 ping PC2
其余效果皆可俩俩互ping,实现全网可达