默认路由实验
拓扑图:

基本配置
ROUTER1
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname r1
r1(config)#enable secret ccna
r1(config)#interface fastEthernet 0/0
r1(config-if)#ip add 10.1.1.1 255.0.0.0
r1(config-if)#no shutdown
r1(config-if)#line vty 0 4
r1(config-line)#login
r1(config-line)#password ccna
r1(config-line)#exit
r1(config)#interface serial 0/0
r1(config-if)#ip add 192.168.10.1 255.255.255.0
r1(config-if)#no shutdown
ROUTER2
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname r2
r2(config)#enable secret ccnp
r2(config)#interface fastEthernet 0/0
r2(config-if)#ip address 172.168.1.1 255.255.0.0
r2(config-if)#no shutdown
r2(config-if)#line vty 0 4
r2(config-line)#login
r2(config-line)#password ccnp
r2(config-line)#exit
r2(config)#interface serial 0/0
r2(config-if)#ip address 192.168.10.2 255.255.255.0
r2(config-if)#no shutdown
r2(config-if)#exit
r2(config)#interface serial 0/1
r2(config-if)#ip address 192.168.20.1 255.255.255.0
r2(config-if)#no shutdown
r2(config-if)#clock rate 56000
r2(config-if)#exit
ROUTER3
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname r3
r3(config)#enable secret ccie
r3(config)#interface fastEthernet 0/0
r3(config-if)#ip address 192.168.1.1 255.255.255.0
r3(config-if)#no shutdown
r3(config-if)#line vty 0 4
r3(config-line)#login
r3(config-line)#password ccie
r3(config-line)#exit
r3(config)#interface serial 0/0
r3(config-if)#ip address 192.168.20.2 255.255.255.0
r3(config-if)#no shutdown
r3(config-if)#exit
 
 
 
配置默认路由:
r1(config)# ip route 0.0.0.0 0.0.0.0 192.168.10.2
r2(config)#ip route 10.0.0.0 255.0.0.0 192.168.10.1
r2(config)#ip route 192.168.1.0 255.255.255.0 192.168.20.2
r3(config)# ip route 0.0.0.0 0.0.0.0 192.168.20.1
 
验证默认路由
r1#show ip route
C    10.0.0.0/8 is directly connected, FastEthernet0/0
C    192.168.10.0/24 is directly connected, Serial0/0
S*   0.0.0.0/0 [1/0] via 192.168.10.2
r2#show ip route
S    10.0.0.0/8 [1/0] via 192.168.10.1
C    172.16.0.0/16 is directly connected, FastEthernet0/0
S    192.168.1.0/24 [1/0] via 192.168.20.2
C    192.168.10.0/24 is directly connected, Serial0/0
C    192.168.20.0/24 is directly connected, Serial0/1
 
r3#show ip route
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.20.0/24 is directly connected, Serial0/0
S*   0.0.0.0/0 [1/0] via 192.168.20.1