【实验目的】
在R1与R4上配置重定向,确保R3与R5之间的网络互相能够访问,(非next-hop-self方式)
【实验拓扑】
【实验基本配置】
R1:
interface FastEthernet0/0
ip address 155.1.146.1 255.255.255.0
!
interface Serial0/0
ip address 155.1.13.1 255.255.255.0
clock rate 2000000
!
router eigrp 2
network 155.1.13.1 0.0.0.0
no auto-summary
!
router bgp 2
neighbor 155.1.13.3 remote-as 2
neighbor 155.1.146.4 remote-as 1
no auto-summary
R3:
interface Loopback0
ip address 155.1.37.3 255.255.255.0
!
interface Serial0/1
ip address 155.1.13.3 255.255.255.0
clock rate 64000
!
router eigrp 2
network 155.1.13.3 0.0.0.0
no auto-summary
!
router bgp 2
network 155.1.37.0 mask 255.255.255.0
neighbor 155.1.13.1 remote-as 2
R4:
interface FastEthernet0/0
ip address 155.1.146.4 255.255.255.0
interface Serial0/0
ip address 155.1.45.4 255.255.255.0
clock rate 2000000
router eigrp 1
network 155.1.45.4 0.0.0.0
no auto-summary
router bgp 1
neighbor 155.1.45.5 remote-as 1
neighbor 155.1.146.1 remote-as 2
R5:
interface Loopback0
ip address 155.1.5.5 255.255.255.0
!
interface Serial0/1
ip address 155.1.45.5 255.255.255.0
clock rate 64000
!
router eigrp 1
network 155.1.45.5 0.0.0.0
no auto-summary
!
router bgp 1
network 155.1.5.0 mask 255.255.255.0
neighbor 155.1.45.4 remote-as 1
【实验前验证】
R3#show ip bgp
Network Next Hop Metric LocPrf Weight Path
* i155.1.5.0/24 155.1.146.4 0 100 0 1 i
*> 155.1.37.0/24 0.0.0.0 0 32768 i
R3#show ip bgp 155.1.5.0
BGP routing table entry for 155.1.5.0/24, version 0
Paths: (1 available, no best path)
Not advertised to any peer
1
155.1.146.4 (
inaccessible) from 155.1.13.1 (155.1.146.1)
Origin IGP, metric 0, localpref 100, valid, internal
在没有配置next-hop-self之前,我们看到结果不可达,原因是,在R3上收到去往155.1.5.0 的下一跳应该是R1的地址(155.1.13.1);由于IGP之间传输BGP路由时不改变下一跳,这就造成了不可达。
R3#show ip route 路由表中冶没有任何去放155.1.146 网络的路由
155.1.0.0/24 is subnetted, 2 subnets
C 155.1.13.0 is directly connected, Serial0/1
C 155.1.37.0 is directly connected, Loopback0
【实验配置】
接下来,我们不用next-hop-self,而采用重定向EGP到IGP中,我们在R1与R4上分别将直连网络重定向到IGP来解决不可达的问题。
R1
router eigrp 2
redistribution connected metric 1 1 1 1 1
R4
router eigrp 1
redistribution connected metric 1 1 1 1 1
【实验验证】
R3#show ip bgp
Network Next Hop Metric LocPrf Weight Path
*>i155.1.5.0/24 155.1.146.4 0 100 0 1 i
*> 155.1.37.0/24 0.0.0.0 0 32768 i
注意这里,虽然下一跳没有改变,但路由表中多了一条去往155.1.146.0 的路由,因此路由器知道怎么走。
R3#show ip route
155.1.0.0/24 is subnetted, 4 subnets
D EX 155.1.146.0 [170/2560512256] via 155.1.13.1, 00:01:21, Serial0/1
C 155.1.13.0 is directly connected, Serial0/1
B 155.1.5.0 [200/0] via 155.1.146.4, 00:00:42
C 155.1.37.0 is directly connected, Loopback0
R3#ping 155.1.5.5 source 155.1.37.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 155.1.5.5, timeout is 2 seconds:
Packet sent with a source address of 155.1.37.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/48/80 ms
本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/992836