PT-Router
串行 DTE
连接两个路由器的 Serial
接口 --- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]: no # 选择no
Press RETURN to get started!
r1>enable # 进入admin模式
r1#
r1#configure terminal # 进入管理终端
Enter configuration commands, one per line. End with CNTL/Z.
r1(config)#interface FastEthernet1/0 # 进入端口1/0
r1(config-if)#ip address 192.168.1.1 255.255.255.0 # 配置端口的ip地址
r1(config-if)#no shutdown # 开启此端口,使它转发数据
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
r1(config-if)#exit # 退出
r1(config)#interface serial 2/0 # 进入S2/0端口模式
r1(config-if)#no shutdown # 开启此端口
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
r1(config-if)#ip address 192.168.2.1 255.255.255.0 # 配置此端口的ip地址
r1(config-if)#clock rate 9600 # 配置此端口的时钟速率
r1(config-if)#exit # 退出
r1(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2 # 配置静态路由
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]: no # 选择no
Press RETURN to get started!
r1>enable # 进入admin模式
r1#
r1#configure terminal # 进入管理终端
Enter configuration commands, one per line. End with CNTL/Z.
r1(config)#interface FastEthernet1/0 # 进入端口1/0
r1(config-if)#ip address 192.168.3.1 255.255.255.0 # 配置端口的ip地址
r1(config-if)#no shutdown # 开启此端口,使它转发数据
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
r1(config-if)#exit # 退出
r1(config)#interface serial 2/0 # 进入S2/0端口模式
r1(config-if)#no shutdown # 开启此端口
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
r1(config-if)#ip address 192.168.2.2 255.255.255.0 # 配置此端口的ip地址
r1(config-if)#exit # 退出
r1(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1 # 配置静态路由
r1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet1/0
C 192.168.2.0/24 is directly connected, Serial2/0
S 192.168.3.0/24 [1/0] via 192.168.2.2
r2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
S 192.168.1.0/24 [1/0] via 192.168.2.1
C 192.168.2.0/24 is directly connected, Serial2/0
C 192.168.3.0/24 is directly connected, FastEthernet1/0
r1#show ip route
r1#show ip interface brief
# 在此实验中,配置应如下
# FastEthernet1/0和Serial2/0的Status应为up,router2同理.
r1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet1/0 192.168.1.1 YES manual up up
Serial2/0 192.168.2.1 YES manual up up
Serial3/0 unassigned YES unset administratively down down
FastEthernet4/0 unassigned YES unset administratively down down
FastEthernet5/0 unassigned YES unset administratively down down
RIP 的配置可在静态路由的基础上进行
r1(config)#no ip route 192.168.3.0 255.255.255.0 192.168.2.2 #删除Router1的转发表
r2(config)#no ip route 192.168.1.0 255.255.255.0 192.168.2.1 #删除Router2的转发表
r1(config)#router rip #进入RIP配置模式
r1(config-router)#version 2 #设置版本号
r1(config-router)#network 192.168.1.0 #声明Router1连接的两个网络的网络号
r1(config-router)#network 192.168.2.0
r2(config)#router rip #进入RIP配置模式
r2(config-router)#version 2 #设置版本号
r2(config-router)#network 192.168.3.0 #声明Router2连接的两个网络的网络号
r2(config-router)#network 192.168.2.0