用aux口背对背连接两台路由器


一般做实验时,一般都用serial口来连接两台路由器,但要哪一天,你的serial口用完了怎么办呢?别着急,其实你还可以使用aux口,运用PPP来连接两台路由器 。
我们知道,一般路由器都会带个aux口,接口类型有两种,一种是RJ45(比如25系列,26系列等),还有一种就是DB25(比如45系列,7000系列等);aux属于DTE设备,所以两个DTE设备相连就需要用到反转线(rollover);假如两端都是RJ45的,那就直接用一根反转网线相连;假如两端是DB25,那就要用到RJ45-DB25的转换头中间连接一个反转线,或直接做一根两头都是DB25头的线,线的连接顺序如下:
DB25 DB25
RxD23TxD
TxD32RxD
CTS45RTS
RTS54CTS
DTR620CD
DSR820CD
CD206DTR
CD208DSR
GND77GND
拓扑图见上 。
配置如下:
Router 1
version 11.1
service udp-small-servers
service tcp-small-servers
!
hostname Router1
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
no ip address
shutdown
!
interface Async1
!---将拨号端口分配给AUX口
!---具体的拨号端口号码可以用#sh line 来查看AUX口的line号
ip address 192.168.0.1 255.255.255.0
!---两台路由器设的地址必须在一个子网里面
encapsulation ppp
!---用PPP来封装数据包
async dynamic routing
!---答应在此线路上运行路由协议
async mode dedicated
!
no ip classless
ip route 0.0.0.0 0.0.0.0 Async1
!---将async1设置为默认路由端口
logging buffered
!
line con 0
exec-timeout 0 0
line aux 0
!---配置AUX的链路层属性
modem InOut
transport input all
!---在此线路上答应跑所有协议--此点非常重要,切记!
rxspeed 38400
!---设置Rx速率 (这个设置两台路由器必须一致)
txspeed 38400
!---设置Tx速率 (这个设置两台路由器必须一致)
flowcontrol hardware
line vty 0 4
login
!
end
-------------------------------------------------
Router 2
version 11.1
service udp-small-servers
service tcp-small-servers
!
hostname Router1
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
no ip address
shutdown
!
interface Async1
!---将拨号端口分配给AUX口
!---具体的拨号端口号码可以用#sh line 来查看AUX口的line号
ip address 192.168.0.2 255.255.255.0
!---两台路由器设的地址必须在一个子网里面
encapsulation ppp
!---用PPP来封装数据包
async dynamic routing
!---答应在此线路上运行路由协议
async mode dedicated
!
no ip classless
ip route 0.0.0.0 0.0.0.0 Async1
!---将async1设置为默认路由端口
logging buffered
!
line con 0
exec-timeout 0 0
line aux 0
!---配置AUX的链路层属性
modem InOut
transport input all
!---在此线路上答应跑所有协议--此点非常重要,切记!
rxspeed 38400
!---设置Rx速率 (这个设置两台路由器必须一致)
txspeed 38400
!---设置Tx速率 (这个设置两台路由器必须一致)
flowcontrol hardware
line vty 0 4
login
!
end
假如出现问题,如何调试呢?可以使用如下命令来查看:
show line
show line aux 0
shutdown和no shutdown来开始和重制aux口的状态

推荐阅读