技术在于专研
分类: 系统运维
2007-02-09 14:13:01
基本配置
----R1--------------------------------------------------------------------------------
interface FastEthernet0/0
ip address
!
interface Serial2/1
ip address
!
interface Serial3/0
ip address
encapsulation frame-relay
!
router rip
version 2
network
network
network
no auto-summary
!
----R2--------------------------------------------------------------------------------
interface Serial2/1
ip address
!
interface Serial2/2
ip address
!
router ospf 1
router-id
log-adjacency-changes
network
!
router rip
version 2
network
no auto-summary
!
----R3--------------------------------------------------------------------------------
interface Serial2/1
ip address
!
interface Serial2/2
ip address 34.34.34.3 255.255.255.0
!
router ospf 1
router-id
log-adjacency-changes
network
network 34.34.34.0
!
----R4--------------------------------------------------------------------------------
interface FastEthernet0/0
ip address
interface Serial2/1
ip address 34.34.34.4 255.255.255.0
!
router ospf 1
router-id
log-adjacency-changes
network 34.34.34.0
!
router rip
version 2
redistribute ospf 1 metric 1
network
no auto-summary
!
----R5--------------------------------------------------------------------------------
interface Loopback0
ip address
!
interface Serial3/0
ip address
encapsulation frame-relay
!
router rip
version 2
network
network
no auto-summary
产生环路:
在R2上将RIP重分布到OSPF中
Router2(config)#router ospf 1
Router2(config-router)# redistribute rip subnets
再R4上将OSPF重分布到RIP中
Router4(config)#router rip
Router4(config-router)# redistribute ospf 1 metric 2
在R1上查看路由表
Router1# show ip route
R
[120/1] vi
为了产生环路,将来自R5的路由的metric改大
Router5(config)#access-list 1 permit
Router5(config)#router rip
Router5(config-router)#offset-list 1 out 2 s3/0
Router1# show ip route
R
环路产生 R4去
Router 4#TRACEROUTE
Type escape sequence to abort.
Tracing the route to
1 34.34.34.3 196 msec 376 msec 388 msec
2
3
4
5 34.34.34.3 720 msec 576 msec 432 msec
6
7
8
解决办法:一
在R4 或R1上做ACL过滤 使R1 上学不到从R4方向来的路由
Router 4(config)#access-list 11 deny
Router 4(config)#access-list 11 permit any
Router 4(config)#router rip
Router 4(config-router)#distribute-list 11 out f0/0
Router1# show ip route
R
Router 4#traceroute
Type escape sequence to abort.
Tracing the route to
1 34.34.34.3 432 msec 144 msec 288 msec
2
3
4
解决办法:二
在R4上取消将OSPF重分布到RIP
再反向RIP中配置默认路由。
Router 4 (config)#router rip
Router 4 (config-router)#no redistribute ospf 1 metric 1
Router 4 (config-router)#default-information originate
此命令将在除R4以外其他运行RIP协议的路由器上产生一条路由,使环路问题解决
Router5#show ip route
R*
Router2#show ip route
R*
Router1#show ip route
R*
Router 4#traceroute
Type escape sequence to abort.
Tracing the route to
1 34.34.34.3 92 msec 144 msec 200 msec
2
3
4
Router 4#ping
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 388/591/776 ms