在小规模网络上只使用iBGP全网互通的方式,使用两种方式实现可达路由的配置。
实验拓扑图如下:
R1的基础配置:
hostname R1
!
interface Loopback0
ip address 192.168.1.1 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.12.1 255.255.255.0
no sh
!
router bgp 123
neighbor 10.1.12.2 remote-as 123
network 192.168.1.1 mask 255.255.255.255
!
R3的基础配置:
hostname R3
!
interface Loopback0
ip address 192.168.3.3 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.23.3 255.255.255.0
no sh
!
route-map RECONN permit 10
match interface Loopback0
router bgp 123
neighbor 10.1.23.2 remote-as 123
redistribute connected route-map RECONN
!
R2的关键基础配置:
hostname R2
!
interface Loopback0
ip address 192.168.2.2 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.12.2 255.255.255.0
no sh
!
interface Ethernet0/1
ip address 10.1.23.2 255.255.255.0
no sh
!
router bgp 123
neighbor CISCO peer-group
neighbor CISCO remote-as 123
neighbor CISCO route-reflector-client
bgp listen range 10.1.0.0/19 peer-group CISCO
redistribute connected
!
简单测试R1的网络可达性,R2和R3也与类似,所以略:
BGP不依赖任何IGP只是用iBGP可达的路由信息来实施相互“搬运”NLRI的方法,也同样可以在一定规模下的网络环境中应用不太复杂的配置实现网络互通。