配置默認路由

1.配置接口IP地址並通過靜態路由、默認路由配置實現全網互通 ,具體如下圖
.配置默認路由

2設置第一臺路由:
<Huawei>u t m //關閉更新消息
Info: Current terminal monitor is off.
<Huawei>sys //進入系統視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r1 //更改名字爲r1
[r1]int g0/0/0 //進入0/0/0接口
[r1-GigabitEthernet0/0/0]ip address 192.168.2.1 24 //設置IP
[r1]int g0/0/1 //進入0/0/1接口
[r1-GigabitEthernet0/0/1]ip address 192.168.1.254 24 //設置IP

設置第二臺路由:
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.2 24
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.3.1 24

設置第三臺路由:
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.4.254 24
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.3.2 24

3.將PC機設置IP地址及網關:
配置默認路由
配置默認路由
4.用ping命令測試互通:
配置默認路由
目前無法互通
5.設置靜態路由模式以及默認路由模式:
用ip route-static命令進行設置
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.2.2 //默認模式
[R2]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1 //靜態模式
[R2]ip route-static 192.168.4.0 255.255.255.0 192.168.3.2
[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.3.1
6.再次測試連通性:
7.可以實現互通

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章