一、实验拓扑

 

BGP基本配置(EIGRP在BGP中的再发布)_第1张图片

二、配置清单

 

R1>en
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface
R1(config-if)#interface l0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#interface f0/1
R1(config-if)#ip address 192.168.13.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#conf t
R1(config-if)#interface f0/0
R1(config-if)#ip address 192.168.12.2 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit 
R1(config)#router eigrp 100
R1(config-router)#network 1.1.1.0 0.0.0.255
R1(config-router)#network 192.168.13.0 0.0.0.255
R1(config-router)#end
R1#conf t
R1(config)#router bgp 200
R1(config-router)#neighbor 192.168.12.1 remote-as 100
R1(config-router)#end
R1#conf t                 
R1(config)#router bgp 200
R1(config-router)# redistribute eig
R1(config-router)# redistribute eigrp 100

R1(config-router)#end

*Nov 11 20:39:32.287: %SYS-5-CONFIG_I: Configured from console by console
----------------------------------------------

R2>en
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#interface f0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#interface
R2(config-if)#interface l0
R2(config-if)#ip address 2.2.2.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#interface f0/1
R2(config-if)#ip address 192.168.24.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#conf t
R2(config-if)#interface f0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit 
R2(config)#router eigrp 100
R2(config-router)#network 2.2.2.0 0.0.0.255
R2(config-router)#network 192.168.24.0 0.0.0.255
R2(config-router)#end
R2#conf t
R2(config)#router bgp 200
R2(config-router)#neighbor 192.168.12.1 remote-as 100
R2(config-router)#end
R2#conf t                 
R2(config)#router bgp 200
R2(config-router)# redistribute eig
R2(config-router)# redistribute eigrp 100

R2(config-router)#end

*Nov 11 20:39:32.287: %SYS-5-CONFIG_I: Configured from console by console
--------------------------------------------------------------------------------
R3:
R3>en
R3#conf t
R3(config)#interface l0
R3(config-if)#ip address 3.3.3.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#interface f0/1
R3(config-if)#ip address 192.168.13.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#conf t
R3(config)#router eigrp 100
R3(config-router)#network 3.3.3.0 0.0.0.255
R3(config-router)#network 192.168.13.0 0.0.0.255

-------------------------------------------------------------------

R4:
R4>en
R4#conf t
R4(config)#interface l0
R4(config-if)#ip address 4.4.4.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#interface f0/1
R4(config-if)#ip address 192.168.24.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#end
R4#conf t
R4(config)#router eigrp 100
R4(config-router)#network 4.4.4.0 0.0.0.255
R4(config-router)#network 192.168.24.0 0.0.0.255
R4(config-router)#end

--------------------------------------------------------------------
三、测试
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, 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

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       1.1.1.0/24 is directly connected, Loopback0
D       1.0.0.0/8 is a summary, 01:11:46, Null0
C    192.168.13.0/24 is directly connected, FastEthernet0/1
     2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B       2.2.2.0/24 [20/0] via 192.168.12.2, 00:30:43
B       2.0.0.0/8 [20/128256] via 192.168.12.2, 00:30:43
D    3.0.0.0/8 [90/156160] via 192.168.13.3, 01:08:36, FastEthernet0/1
B    4.0.0.0/8 [20/156160] via 192.168.12.2, 00:30:43
B    192.168.24.0/24 [20/0] via 192.168.12.2, 00:30:43
----------------------
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, 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

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B       1.1.1.0/24 [20/0] via 192.168.12.1, 00:32:26
B       1.0.0.0/8 [20/128256] via 192.168.12.1, 00:32:26
B    192.168.13.0/24 [20/0] via 192.168.12.1, 00:32:26
     2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       2.2.2.0/24 is directly connected, Loopback0
D       2.0.0.0/8 is a summary, 00:47:38, Null0
B    3.0.0.0/8 [20/156160] via 192.168.12.1, 00:32:26
D    4.0.0.0/8 [90/156160] via 192.168.24.4, 00:46:52, FastEthernet0/1
C    192.168.24.0/24 is directly connected, FastEthernet0/1
---------------------
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, 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

D    1.0.0.0/8 [90/156160] via 192.168.13.1, 01:11:01, FastEthernet0/1
C    192.168.13.0/24 is directly connected, FastEthernet0/1
     3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       3.3.3.0/24 is directly connected, Loopback0
D       3.0.0.0/8 is a summary, 01:11:03, Null0
---------------------
R3#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
结论:R3只运行EIGRP没有学习BGP 中的路由。


R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.13.1          

R4(config)#ip route 0.0.0.0 0.0.0.0 192.168.24.2


R3#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/54/92 ms
R3#