二、配置路由器接口
  兄弟也是初学者,还望能向大家学习,有错误的地方还望大家多多指教,多多批评。QQ:94283594
实验拓扑:
1、ip地址表:
                       R1          S2/0         172.16.10.1/24 
                       R2          S2/0         172.16.10.2/24 
                       R2          S3/0         172.16.20.1/24 
                       R3          S2/0         172.16.20.2/24 
      将路由器的hostname改为R1\R2\R3
Router>enable//由用户模式进入特权模式
Router#configure terminal //由特权模式进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z
Router(config)#hostname R1//设置hostname为R1
R1#write//保存设置
 
R1#show controllers serial 2/0//查看物理接口类型主要用于查看连接的是DTE还
                                                        是DCE端
Interface Serial2/0
Hardware is PowerQUICC MPC860
DTE V.35 clocks stopped.      //DTE端不需要配置时钟,DCE需要配置时钟
 
R1的配置:
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface serial 2/0//进入S2/0
R1(config-if)#description Connection to R2//主要端口设置描述
R1(config-if)#ip address 172.16.10.1 255.255.255.0//设置端口ip
R1(config-if)#no shutdown//设为激活状态
%LINK-5-CHANGED: Interface Serial2/0, changed state to down//因为对端没有激活所
                                                                                                                    以仍然为down
R1(config-if)#end//推出全局模式
R1#write//保存设置
 
R2的配置:
R2>en
R2#show controllers serial 2/0
Interface Serial2/0
Hardware is PowerQUICC MPC860
DCE V.35, no clock//DCE端需要配置时钟
R2#show controllers serial 3/0
Interface Serial3/0
Hardware is PowerQUICC MPC860
DCE V.35, no clock//DCE端需要配置时钟
 
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#interface serial 2/0// 进入接口S2/0
R2(config-if)#ip address 172.16.10.2 255.255.255.0//接口S2/0配ip
R2(config-if)#no shutdown //激活接口,此时对端R1的接口变为up
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
R2(config-if)#clock rate 64000//设置时钟
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R2(config-if)#exit
R2(config)#interface serial 3/0
R2(config-if)#ip address 172.16.20.1 255.255.255.0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial3/0, changed state to down//因为对端没有激活所
                                                                                                                    以仍然为down
R2(config-if)#clock rate 64000
R2(config-if)#exit
R2(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R2#write//保存配置
 
R3的配置:
R3(config)#interface serial 2/0
R3(config-if)#ip address 172.16.20.2 255.255.255.0
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
R3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R3(config-if)#exit
R3(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R3#writ
 
验证配置:
R2#ping 172.16.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/42/54 ms
R2#ping 172.16.20.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/36/46 ms