分类: 系统运维
2009-05-15 11:33:28
环境:两台
2500系列路由器由串口相连。 要求:如下图所示,在R1和R2上运行RIPv1,让两端能够学习到对端的路由以达到通信的目的。
步骤一、基本配置
Router>
Router>enable
Router#config terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup à关闭域名查找
R1(config)#line console 0
R1(config-line)# logging synchronous à命令输入达到同步
R1(config-line)#exec-timeout 0 0 à设置永不超时
R1(config-line)#exit
步骤二、接口IP配置
R1的配置:
R1(config)#interface s0
R1(config-if)#ip address 30.1.1.1 255.255.255.0
R1(config-if)#clock rate 64000 à注意时钟速率端
R1(config-if)#no shutdown
R1(config-if)#interface loopback 0
R1(config-if)#ip address
R1(config-if)#
R2的配置:
Router(config)#hostname R2
R2(config)#interface s1
R2(config-if)#ip address 30.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#interface loopback 0
R2(config-if)#ip address
R2(config-if)#exit
R2(config)#
步骤三、启用RIP路由选择协议
R1的配置:
R1(config)#router rip à启用RIP
R1(config-router)#network 30.0.0.0 à发布直连网段
R1(config-router)#network
R1(config-router)#exit
R1(config)#
R2的配置:
R2(config)#router rip à启用RIP
R2(config-router)#network
R2(config-router)#network 30.0.0.0
R2(config-router)#exit
R2(config)#end
步骤四、显示路由表,查看路由条目
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
R
C
30.0.0.0/24 is subnetted, 1 subnets
C 30.1.1.0 is directly connected, Serial0
步骤五、用扩展ping命令测试连通性
R2#ping
Protocol [ip]:
Target IP address:
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
!!!!!
步骤六、显示你当前路由协议
R2#show ip protocols à显示你当前路由协议配置情况和运行状态
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 24 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is
Incoming update filter list for all interfaces is
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
Loopback0 1 1 2
Serial1 1 1 2
Automatic network summarization is in effect
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
30.1.1.1 120 00:14:05
Distance: (default is 120)
步骤七、显示当前配置
r1的当前配置:
r1#show running-config
!
hostname R1
!
no ip domain-lookup
!
interface Loopback0
ip address
!
interface Serial0
ip address 30.1.1.1 255.255.255.0
clockrate 64000
!
router rip
network 30.0.0.0
network
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
end
r2的当前配置:
R2#sh run
!
hostname R2
!
no ip domain-lookup
!
interface Loopback0
ip address
!
interface Serial1
ip address 30.1.1.2 255.255.255.0
!
router rip
network 30.0.0.0
network
!
line con 0
exec-timeout 0 0
logging synchronous
!
end
偶不总结了~知道v1和v2就好了~!