静态路由实验
原创
©著作权归作者所有:来自51CTO博客作者北京菜丫的原创作品,请联系作者获取转载授权,否则将追究法律责任
PC1能够ping通PC2
#R1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R1
[R1]int gi0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[R1-GigabitEthernet0/0/0]int gi0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.1 24
[R1-GigabitEthernet0/0/1]q
#缺省路由
[R1]ip route-static 0.0.0.0 0 12.1.1.2
#R2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R2
[R2]int gi0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[R2-GigabitEthernet0/0/0]int gi0/0/1
[R2-GigabitEthernet0/0/1]ip add 23.1.1.2 24
[R2-GigabitEthernet0/0/1]q
[R2]ip route-static 192.168.1.0 24 12.1.1.1
[R2]ip route-static 192.168.2.0 24 23.1.1.3
#R3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R3
[R3]int gi0/0/0
[R3-GigabitEthernet0/0/0]ip add 23.1.1.3 24
[R3-GigabitEthernet0/0/0]int gi0/0/1
[R3-GigabitEthernet0/0/1]ip ad 192.168.2.1 24
[R3-GigabitEthernet0/0/1]q
[R3]ip route-static 192.168.1.0 24 23.1.1.2
#PC2 Ping R1路由器不通
正常的。因为没R3没做到达12.1.1.0的路由。这就是R1缺省路由和R3静态路由的区别!!!