缺省路由是目的地址和掩码全为0的特殊路由
如果报文的目的地址无法匹配路由表中的任何一项,路由器将选择依照缺省路由来转发报文。
ip route-static 0.0.0.0 0.0.0.0
实验要求:
1、按照图中的要求配置IP
2、要求使用静态协议缺省实现访问2.0、3.0、4.0
1.配置IP
<Huawei>sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 12.1.1.1 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]ip route-static 0.0.0.0 0 g0/0/1 12.1.1.1
[Huawei]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/1 12.1.1.2
<Huawei>sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[Huawei-GigabitEthernet0/0/0]q
[Huawei]int LoopBack 1
[Huawei-LoopBack1]ip address 192.168.2.1 24
[Huawei-LoopBack1]int LoopBack 2
[Huawei-LoopBack2]ip address 192.168.3.1 24
[Huawei-LoopBack2]int LoopBack 3
[Huawei-LoopBack3]ip address 192.168.4.1 24
[Huawei-LoopBack3]q
[Huawei]ip route-static 192.168.1.1 24 g0/0/0 12.1.1.1