静态路由 华三静态路由

静态路由 华三静态路由
文章图片

1配置各个路由的名称和端口IP
(1)配置R1路由
[Huawei]sys r1
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.10.1 24
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.12.1 24
(2)配置R2路由
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.12.2 24
Apr 26 2020 12:17:07-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int g0/0/1
^
Error: Unrecognized command found at ‘^’ position.
[Huawei-GigabitEthernet0/0/1]ip add 192.168.23.1 24
Apr 26 2020 12:18:14-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei-GigabitEthernet0/0/1]sys 2
[2]
[2]sys r2
save
[r2]
(3)配置R3路由器
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.23.2 24
Apr 26 2020 12:22:42-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.34.1 24
[r3-GigabitEthernet0/0/1]
[r3]vlan 20
[r3-vlan20]
[r3-vlan20]int vlanif 20
[r3-Vlanif20]ip add 192.168.20.1 24
[r3-Vlanif20]qu
[r3]int et0/0/0
[r3-Ethernet0/0/0]port link-rype acce
[r3-Ethernet0/0/0]port link-type access
[r3-Ethernet0/0/0]port default vlan 20
[r3-Ethernet0/0/0]port default vlan 20
Apr 26 2020 13:44:18-08:00 r3 %%01IFNET/4/IF_STATE(l)[0]:Interface Vlanif20 has
turned into UP state.
[r3-Ethernet0/0/0]
[r3-Ethernet0/0/0]
Apr 26 2020 13:44:18-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface Vlanif20 has entered the UP state.
[r3]q
save
The current configuration will be written to the device.
Are you sure to continue? (y/n)[n]:y
It will take several minutes to save configuration file, please wait…
Configuration file had been saved successfully
Note: The configuration file will take effect after being activated

(4)路由器4的配置
[Huawei]sys r4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.34.2
^
Error:Incomplete command found at ‘^’ position.
[r4-GigabitEthernet0/0/0]ip add 192.168.34.2 24
Apr 26 2020 13:54:32-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r4-GigabitEthernet0/0/0]vlan 30
[r4-vlan30]qu
[r4]int vlanif 30
[r4-Vlanif30]ip add 192.168.30.1 24
[r4-Vlanif30]int et0/0/0
[r4-Ethernet0/0/0]port link-type access
[r4-Ethernet0/0/0]port default vlan 30
Apr 26 2020 13:57:22-08:00 r4 %%01IFNET/4/IF_STATE(l)[1]:Interface Vlanif30 has
turned into UP state.
[r4-Ethernet0/0/0]
[r4-Ethernet0/0/0]
Apr 26 2020 13:57:22-08:00 r4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface Vla
[r4-Ethernet0/0/0]
[r4-Ethernet0/0/0]
[r4-Ethernet0/0/0]qu
[r4]qu
save
2配置每台路由器的路由表
1路由器1的路由表
[r1]ip route-static 192.168.20.0 24 192.168.12.2
[r1]ip route-static 192.168.30.0 24 192.168.12.2
[r1]ip route-static 192.168.34.0 24 192.168.12.2
[r1]ip route-static 192.168.23.0 24 192.168.12.2
[r1]
2路由器2的路由表
[r2]ip route-static 192.168.10.0 24 192.168.12.1
[r2]ip route-static 192.168.20.0 24 192.168.23.2
[r2]ip route-static 192.168.30.0 24 192.168.23.2
[r2]ip route-static 192.168.34.0 24 192.168.23.2
[r2]
3路由器3的路由表
[r3]ip route-static 192.168.10.1 24 192.168.23.1
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.10.0/24 was generated.
[r3]ip route-static 192.168.12.1 24 192.168.23.1
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.12.0/24 was generated.
[r3]ip route-static 192.168.30.1 24 192.168.34.2
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.30.0/24 was generated.
[r3]
【静态路由 华三静态路由】4路由器4的路由表
[r4]ip route-static 192.168.10.1 24 192.168.34.1
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.10.0/24 was generated.
[r4]ip route-static 192.168.12.1 24 192.168.34.1
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.12.0/24 was generated.
[r4]ip route-static 192.168.23.1 24 192.168.34.1
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.23.0/24 was generated.
[r4]ip route-static 192.168.20.1 24 192.168.34.1
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.20.0/24 was generated.
[r4]
此时pc互相都通了

    推荐阅读