ENSP学习day3

静态路由实验

路由器划分成3个广播域,如图
ENSP学习day3_第1张图片
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24

1.PC必须配置网关地址:网关地址是网段中连接其他网段的路由器的接口上的接口地址
2.AR1配置:
[Huawei]sysname AR1
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[AR1-GigabitEthernet0/0/0]int g0/0/1
[AR1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
3. AR2配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR2
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip address 192.168.2.2 24
Mar 15 2025 22:21:22-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip address 192.168.3.254 24
Mar 15 2025 22:21:54-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
4. 查询路由表;此时R1中不包含R2信息;R2不包含R1地址信息
[AR1]display ip routing-table
5.配置静态路由:
目标网段 掩码 下一跳IP
[AR2]ip route-static 192.168.1.0 24 192.168.2.1
sys
Enter system view, return user view with Ctrl+Z.
[AR1]ip route-static 192.168.3.0 24 192.168.2.2

display IP routing-table
5. PC1可以ping通PC2了

浅浅总结一波:
PC配置IP地址,
router配置接口IP
分别配置静态路由,R1对192.168.3.0/24网段
R2对192.168.1.0/24网段
因为跨路由器了,不是直连,direct路由表中没有,如果不加,路由器不知道向哪里转发,所以消息无法到达

你可能感兴趣的:(ENSP实验,学习,智能路由器,网络)