静态路由配置来实现全网互通
R1路由器的配置
第一步:配置Ethernet 0/0/0端口
<Huawei>system-view
[Huawei]interface Ethernet 0/0/0
[Huawei-Ethernet0/0/0]ip address 192.168.1.254 255.255.255.0
[Huawei-Ethernet0/0/0]undo shutdown
[Huawei-Ethernet0/0/0]quit
第二步:配置GigabitEthernet 0/0/0端口
<Huawei>system-view
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.2.1 255.255.255.0
[Huawei-GigabitEthernet0/0/0]undo shutdown
[Huawei-GigabitEthernet0/0/0]quit
第三步:添加静态路由条目(3.0网段),其中192.168.2.2称为下一跳
<Huawei>system-view
[Huawei]ip route-static 192.168.3.0 255.255.255.0 192.168.2.2
R2路由器的配置
第一步:配置Ethernet0/0/0端口
<Huawei>system-view
[Huawei-Ethernet0/0/0]ip address 192.168.3.254 255.255.255.0
[Huawei-Ethernet0/0/0]undo shutdown
[Huawei-Ethernet0/0/0]q
配二步:置GigabitEthernet0/0/0端口
<Huawei>system-view
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.2.2 255.255.255.0
[Huawei-GigabitEthernet0/0/0]undo shutdown
[Huawei-GigabitEthernet0/0/0]quit
第三步:添加静态路由条目(1.0网段)
<Huawei>system-view
[Huawei]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1
最后save
原文地址:https://blog.51cto.com/14190698/2360354