当前位置:文档之家› RIP和OSPF重分布

RIP和OSPF重分布

R3(config-if)#no shut
R3()#ex
R3(config)#int f0/0
R3(config-if)#ip add 192.168.3.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#router ospf 1
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
R3(config-router)#network 192.168.4.0 255.255.255.0 area 0
R3(config-router)#network 192.168.3.0 255.255.255.0 area 0
R3(config-router)#end
R3#
R3参考配置:
R3#show run
speed auto
!
router rip
version 2
network 192.168.1.0
network 192.168.2.0
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
R1#
R2
Router>en
Router#conf t
Router(config)#host R2
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
R3#
R2(config-if)#
R2(config-if)#ip add 192.168.4.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.2.0
R1
Router>en
Router#conf t
Router(config)#host R1
R1(config)#int f0/1
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#int f0/0
R1(config-router)#network 192.168.1.0
R1(config-router)#ex
R1(config)#
R1(config)#ex
R1参考配置:
R1#show run
Building configuration...
Current configuration : 495 bytes
!
!
!
interface FastEthernet0/0
ip address 192.168.2.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.1.1 255.255.255.0
duplex auto
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.4.2 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
redistribute rip
ip address 192.168.4.1 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 192.168.4.00.0.0.255 area 0
network 192.168.3.00.0.0.255 area 0
no service timestamps debug datetime msec
no service password-encryption
!
hostname R2
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
Building configuration...
Current configuration : 544 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
R2(config-router)#redistribute connected
R2(config-router)#ex
R2参考配置:
R2#show run
Building configuration...
Current configuration : 642 bytes
!
version 12.2
no service timestamps log datetime msec
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
R2#
R3:
Router>en
Router#conf t
Router(config)#host R3
R3(config)#int f0/1
R3(config-if)#ip add 192.168.4.1 255.255.255.0
R2(config-router)#ex
R2(config)#router ospf 1
R2(config-router)#network 192.168.4.0 255.255.255.0 area 0
R2(config-router)#ex
R2(config)#ex
R2#
路由重分布
R2(config)#router ospf 1
R2(config)#int f0/0
R2(config-if)#ip add 192.168.2.2 255.255.255.0
R2(config-if)#ex
R2(config)#int f0/0
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#int f0/1
R1(config-if)#ip add 192.168.2.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.168.2.0
no service password-encryption
!
hostname R3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.3.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
R2(config-router)#redistribute rip
R2(config-router)#redistribute connected
R2(config-router)#ex
R2(config)#router rip
R2(config-router)#redistribute ospf 1
redistribute connected
network 192.168.4.00.0.0.255 area 0
!
router rip
version 2
redistribute ospf 1
redistribute connected
network 192.168.2.0
!
ip classless
相关主题