2、需求分析
网络设备在启动之后,当设备的接口处于UP状态时,设备能够自己去发现去往与自己接口直连相 连的网络的路由。
3、所有配置内容
路由器操作如下:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR1
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 192.168.1.100 24
Apr 22 2023 19:16:16-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[AR1-GigabitEthernet0/0/0]q
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 12.1.1.1 30
Apr 22 2023 19:16:55-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[AR1-GigabitEthernet0/0/1]q
[AR1]ip route-static 23.1.1.0 30 12.1.1.2
[AR1]ip route-static 192.168.2.0 24 12.1.1.2
[AR1]ip route-static 192.168.3.0 24 12.1.1.2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR2
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip address 192.168.2.100 24
Apr 22 2023 19:18:56-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]q
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ip address 12.1.1.2 30
Apr 22 2023 19:19:32-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[AR2-GigabitEthernet0/0/1]q
[AR2]interface GigabitEthernet 0/0/2
[AR2-GigabitEthernet0/0/2]ip address 23.1.1.1 30
Apr 22 2023 19:20:08-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[AR2-GigabitEthernet0/0/2]q
[AR2]ip route-static 192.168.1.0 24 12.1.1.1
[AR2]ip route-static 192.168.3.0 24 23.1.1.2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR3
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]ip address 192.168.3.100 24
Apr 22 2023 19:21:37-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[AR3-GigabitEthernet0/0/0]q
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]ip address 23.1.1.2 30
Apr 22 2023 19:22:12-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[AR3-GigabitEthernet0/0/1]q
[AR3]ip route-static 192.168.1.0 24 23.1.1.1
[AR3]ip route-static 192.168.2.0 24 23.1.1.1
[AR3]ip route-static 12.1.1.0 30 23.1.1.1
客户端操作如下:
4、测试结果