五、配置默认路由
    实验拓扑:
五、配置默认路由_CCNA
1、ip地址表:
                       PC1         ip            192.168.10.2/24 
                                Gateway       192.168.10.1
                       PC2         ip            192.168.30.2/24 
                                Gateway       192.168.30.1
                       R1          F0/0         192.168.10.1/24 
                       R1          S2/0         192.168.20.1/24 
                       R2          F0/0         192.168.30.1/24 
                       R2          S2/0         192.168.20.2/24 
2、
R1的配置:
R1(config)#interface fastEthernet 0/0  //进入接口模式
R1(config-if)#ip address 192.168.10.1 255.255.255.0  //配置接口地址
R1(config-if)#no shutdown  //激活接口
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#interface serial 2/0 //进入接口模式
R1(config-if)#ip address 192.168.20.1 255.255.255.0  //配置接口地址
R1(config-if)#no shutdown  //激活接口
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
R1(config-if)#exit
R1(config)#ip route
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.20.2  //配置默认路由R2的S2/0
R1(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R1#write
Destination filename [startup-config]?
Building configuration...
[OK]
R1#
 
R2的配置:
R2(config)#interface fastEthernet 0/0 //进入接口模式
R2(config-if)#ip address 192.168.30.1 255.255.255.0 //配置接口地址
R2(config-if)#no shutdown  //激活接口
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#exit
R2(config)#interface serial 2/0 //进入接口模式
R2(config-if)#ip address 192.168.20.2 255.255.255.0 //配置接口地址
R2(config-if)#clock rate 64000  //设置时钟频率,R1和R2哪端是DCE端就在哪端设时钟,查看命令#show controllers serial 2/0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
R2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R2(config-if)#exit
R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.20.1  //配置默认路由R1的S2/0
R2(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R2#write
Destination filename [startup-config]?
Building configuration...
[OK]
R2#
 
验证配置:
PC1去ping  PC2
PC>ping 192.168.30.2
Pinging 192.168.30.2 with 32 bytes of data:
Request timed out.
Reply from 192.168.30.2: bytes=32 time=129ms TTL=126
Reply from 192.168.30.2: bytes=32 time=106ms TTL=126
Reply from 192.168.30.2: bytes=32 time=106ms TTL=126
通了,说明默认路由实验成功!!!!!!!!!!