实验要求:
配置BGP属性并通过实验了解其作用。
实验环境:
实验配置:
端口配置:
IOU1:
config terminal
interface e0/0
ip address 12.12.12.1 255.255.255.0
no shutdown
interface e0/1
ip address 45.45.45.1 255.255.255.0
no shutdown
interface loopback 0
ip address 1.1.1.1 255.255.255.255
no shutdown
exit
IOU2:
config terminal
interface e0/0
ip address 12.12.12.2 255.255.255.0
no shutdown
interface e0/1
ip address 23.23.23.1 255.255.255.0
no shutdown
interface loopback 0
ip address 2.2.2.2 255.255.255.0
no shutdown
exit
IOU3:
config terminal
interface e0/0
ip address 34.34.34.1 255.255.255.0
no shutdown
interface e0/1
ip address 45.45.45.2 255.255.255.0
no shutdown
interface loop 0
ip address 3.3.3.3 255.255.255.255
no shutdown
exit
IOU4:
config terminal
interface e0/0
ip address 34.34.34.2 255.255.255.0
no shutdown
interface e0/1
ip address 23.23.23.2 255.255.255.0
no shutdown
interface loop 0
ip address 4.4.4.4 255.255.255.0
no shutdown
exit
配置EIGRP:
IOU1:
router eigrp 1
network 1.1.1.1 0.0.0.0
network 12.12.12.1 0.0.0.0
network 45.45.45.1 0.0.0.0
exit
IOU2:
router eigrp 1
network 2.2.2.2 0.0.0.0
network 12.12.12.2 0.0.0.0
exit
IOU3:
router eigrp 1
network 3.3.3.3 0.0.0.0
network 45.45.45.2 0.0.0.0
exit
配置BGP:
IOU1:
router bgp 100
bgp router-id 1.1.1.1
neighbor 2.2.2.2 remote-as 100
neighbor 3.3.3.3 remote-as 100
neighbor 2.2.2.2 update-source loopback 0
neighbor 3.3.3.3 update-source loopback 0
neighbor 2.2.2.2 next-hop-self
neighbor 3.3.3.3 next-hop-self
network 1.1.1.1 mask 255.255.255.255
network 12.12.12.0 mask 255.255.255.0
network 45.45.45.0 mask 255.255.255.0
exit
IOU2:
router bgp 100
bgp router-id 2.2.2.2
neighbor 1.1.1.1 remote-as 100
neighbor 3.3.3.3 remote-as 100
neighbor 23.23.23.2 remote-as 200
neighbor 1.1.1.1 update-source loopback 0
neighbor 3.3.3.3 update-source loopback 0
neighbor 1.1.1.1 next-hop-self
neighbor 3.3.3.3 next-hop-self
network 2.2.2.2 mask 255.255.255.255
network 12.12.12.0 mask 255.255.255.0
network 23.23.23.0 mask 255.255.255.0
exit
IOU3:
router bgp 100
bgp router-id 3.3.3.3
neighbor 1.1.1.1 remote-as 100
neighbor 2.2.2.2 remote-as 100
neighbor 34.34.34.2 remote-as 200
neighbor 1.1.1.1 update-source loopback 0
neighbor 2.2.2.2 update-source loopback 0
neighbor 1.1.1.1 next-hop-self
neighbor 2.2.2.2 next-hop-self
network 3.3.3.3 mask 255.255.255.255
network 45.45.45.0 mask 255.255.255.0
network 34.34.34.0 mask 255.255.255.0
exit
IOU4:
router bgp 200
neighbor 23.23.23.1 remote-as 100
neighbor 34.34.34.1 remote-as 100
network 4.4.4.4 mask 255.255.255.255
network 23.23.23.0 mask 255.255.255.0
network 34.34.34.0 mask 255.255.255.0
exit
起源属性:
IOU4:
ip prefix-list 1 permit 4.4.4.0/24
route-map origin permit 10
match ip address prefix-list 1
set origin egp 900
exit
route-map origin permit 20
exit
router bgp 200
neighbor 23.23.23.1 route-map origin out
exit
AS-Path属性:
IOU4:
ip prefix-list 1 permit 4.4.4.0/24
route-map aspath permit 10
match ip address prefix-list 1
set as-path prepend 600 700
exit
router bgp 200
neighbor 34.34.34.1 route-map aspath out
exit
LOCAL_PREF 属性:
IOU3:
ip prefix-list 1 permit 4.4.4.0/24
route-map local_pref permit 10
match ip address prefix-list 1
set local-preference 2000
exit
route-map local_pref permit 20
exit
router bgp 100
neighbor 34.34.34.2 route-map local_pref in
exit
Weight属性:
IOU2:
router bgp 100
neighbor 1.1.1.1 weight 200
neighbor 3.3.3.3 weight 200
neighbor 23.23.23.2 weight 500
exit
配置完成,实验结束。如有疏漏,还请读者指出。