三路由器通過添加靜態路由條目實現全網互通
阿新 • • 發佈:2019-03-10
system-v size 0.0.0.0 ges sys sha 3.2 blog 路由器 第一步:分別先配置客戶端和路由器的ip
R1路由器的配置
<Huawei>system-view
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.254 255.255.255.0
[Huawei-GigabitEthernet0/0/0]undo shutdown
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.1 255.255.255.0
[Huawei-GigabitEthernet0/0/1]undo shutdown
[Huawei-GigabitEthernet0/0/1]quit [Huawei-GigabitEthernet0/0/1]ip address 192.168.2.2 255.255.255.0
[Huawei-GigabitEthernet0/0/1]undo shutdown
[Huawei-GigabitEthernet0/0/2]ip address 192.168.3.2 255.255.255.0
[Huawei-GigabitEthernet0/0/2]undo shutdown
[Huawei-GigabitEthernet0/0/2]quit [Huawei-GigabitEthernet0/0/0]undo shutdown
[Huawei-GigabitEthernet0/0/2]ip address 192.168.3.1 255.255.255.0
[Huawei-GigabitEthernet0/0/2]undo shutdown
[Huawei-GigabitEthernet0/0/2]quit
第二步:添加靜態路由條目
R1 添加靜態路由條目
[Huawei]ip route-static 192.168.3.0 255.255.255.0 192.168.2.2
[Huawei]ip route-static 192.168.4.0 255.255.255.0 192.168.2.2
R1路由器的配置
<Huawei>system-view
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.254 255.255.255.0
[Huawei-GigabitEthernet0/0/0]undo shutdown
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.1 255.255.255.0
[Huawei-GigabitEthernet0/0/1]undo shutdown
[Huawei-GigabitEthernet0/0/1]quit
R2路由器的配置
<Huawei>system-view
[Huawei-GigabitEthernet0/0/1]undo shutdown
[Huawei-GigabitEthernet0/0/2]ip address 192.168.3.2 255.255.255.0
[Huawei-GigabitEthernet0/0/2]undo shutdown
[Huawei-GigabitEthernet0/0/2]quit
R3路由器的配置
<Huawei>system-view
[Huawei-GigabitEthernet0/0/0]ip address 192.168.4.254 255.255.255.0
[Huawei-GigabitEthernet0/0/2]ip address 192.168.3.1 255.255.255.0
[Huawei-GigabitEthernet0/0/2]undo shutdown
[Huawei-GigabitEthernet0/0/2]quit
第二步:添加靜態路由條目
R1 添加靜態路由條目
[Huawei]ip route-static 192.168.3.0 255.255.255.0 192.168.2.2
[Huawei]ip route-static 192.168.4.0 255.255.255.0 192.168.2.2
R2 添加靜態路由條目
[Huawei]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1
[Huawei]ip route-static 192.168.4.0 255.255.255.0 192.168.3.1
R3 添加靜態路由條目
[Huawei]ip route-static 192.168.1.0 255.255.255.0 192.168.3.2
[Huawei]ip route-static 192.168.2.0 255.255.255.0 192.168.3.2
備註:
對R1,R3 也可以添加默認路由(缺省路由)條目
對R1 :[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.2.2
對R3 :[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.3.2
三路由器通過添加靜態路由條目實現全網互通