SỬ DỤNG PEER GROUPS TRONG BGP
1. Mục tiêu
Trong bài lab này, chúng ta sẽ sử dụng Peer Group để đơn giản hóa việc cấu hình
2. Hoàn cảnh
Mạng của Công ty ABC ở Sài Gòn (AS 100) sử dụng giao thức định tuyến BGP trao đổi thông tin định tuyến với ISP1 (AS 200) và ISP2 (AS 300). Công ty ABC sử dụng chung một routing policy cho cả hai ISP. Ta sẽ sử dụng Peer Group để việc cấu hình được đơn giản hóa.
3. Thực hiện
a. Bước 1
Kết nối mạng theo sơ đồ như trên. Cấu hình hostname, địa chỉ IP các interface serial, loopback theo đúng sơ đồ. Chưa cấu hình routing protocol. Kiểm tra các kết nối trực tiếp bằng lệnh ping và show cdp neighbor.
b. Bước 2
Cấu hình định tuyến EBGP cho các router ISP1 và router ISP2:
ISP1(config)#router bgp 200
ISP1(config-router)neighbor 192.168.1.6 remote-as 100
ISP1(config-router)network 1.0.0.0
ISP2(config)#router bgp 300
ISP2(config-router)neighbor 172.24.1.17 remote-as 200
ISP2(config-router)network 3.0.0.0
c. Bước 3
Sử dụng Peer Group cấu hình router SaiGon áp dụng routing policy cho cả hai router ISP1 và ISP2:
SaiGon(config)#route-map External 10
SaiGon(config-route-map)#set community 40
SaiGon(config-route-map)#exit
SaiGon(config)#router bgp 100
SaiGon(config-router)#network 2.0.0.0
SaiGon(config-router)#neighbor EBGP_PEERS peer-group
SaiGon(config-router)#neighbor EBGP_PEERS send-community
SaiGon(config-router)#neighbor EBGP_PEERS route-map External out
SaiGon(config-router)#neighbor 192.168.1.5 remote-as 200
SaiGon(config-router)#neighbor 172.24.1.18 remote-as 300
SaiGon(config-router)#neighbor 192.168.1.5 peer-group EBGP_PEERS
SaiGon(config-router)#neighbor 172.24.1.18 peer-group EBGP_PEERS
Thiết lập lại liên kết BGP giữa các router bằng lệnh clear ip bgp *. Sau đó, kiểm tra cấu hình BGP trên các router ISP1 và ISP2, hai router này phải có cấu hình tương tự nhau.
ISP1#show ip bgp 2.0.0.0
BGP routing table entry for 2.0.0.0/8, version 9
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
100
192.168.1.6 from 192.168.1.6 (2.0.0.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 40
SaiGon#show ip bgp peer-group
BGP peer-group is EBGP_PEERS
BGP version 4
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP neighbor is EBGP_PEERS, peer-group external, members:
172.24.1.18 192.168.1.5
Index 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor
Route map for outgoing advertisements is External
Update messages formatted 4, replicated 2
SaiGon#show ip bgp neighbors
BGP neighbor is 172.24.1.18, remote AS 300, external link
Member of peer-group EBGP_PEERS for session parameters
BGP version 4, remote router ID 3.0.0.1
BGP state = Established, up for 00:11:46
Last read 00:00:45, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
Received 49 messages, 3 notifications, 0 in queue
Sent 55 messages, 14 notifications, 0 in queue
Route refresh request: received 0, sent 0
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 4, neighbor version 4
Index 2, Offset 0, Mask 0x4
EBGP_PEERS peer-group member
Community attribute sent to this neighbor
Outbound path policy configured
Route map for outgoing advertisements is External
1 accepted prefixes consume 36 bytes
Prefix advertised 5, suppressed 0, withdrawn 1
Connections established 3; dropped 1
Last reset 00:12:30, due to User reset
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 172.24.1.17, Local port: 11022
Foreign host: 172.24.1.18, Foreign port: 179
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)
BGP neighbor is 192.168.1.5, remote AS 200, external link
Member of peer-group EBGP_PEERS for session parameters
BGP version 4, remote router ID 1.0.0.1
BGP state = Established, up for 00:12:01
Last read 00:00:00, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
Received 61 messages, 0 notifications, 0 in queue
Sent 63 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 4, neighbor version 4
Index 2, Offset 0, Mask 0x4
EBGP_PEERS peer-group member
Community attribute sent to this neighbor
Outbound path policy configured
Route map for outgoing advertisements is External
1 accepted prefixes consume 36 bytes
Prefix advertised 4, suppressed 0, withdrawn 0
Connections established 4; dropped 2
Last reset 00:12:41, due to User reset
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 192.168.1.6, Local port: 179
Foreign host: 192.168.1.5, Foreign port: 11003
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)
4. Cấu hình
SaiGon#show running-config
Building configuration…
Current configuration:
!
version 11.3
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SaiGon
!
no ip domain-lookup
!
interface Loopback0
ip address 2.0.0.1 255.0.0.0
!
interface Serial0/0
ip address 192.168.1.6 255.255.255.252
clockrate 64000
!
interface Serial0/1
ip address 172.24.1.17 255.255.255.252
clockrate 64000
!
router bgp 100
network 2.0.0.0
neighbor EBGP_PEERS peer-group
neighbor EBGP_PEERS send-community
neighbor EBGP_PEERS route-map External out
neighbor 172.24.1.18 remote-as 300
neighbor 172.24.1.18 peer-group EBGP_PEERS
neighbor 192.168.1.5 remote-as 200
neighbor 192.168.1.5 peer-group EBGP_PEERS
!
ip classless
!
route-map External permit 10
set community 40
!
line con 0
logging synchronous
line aux 0
line vty 0 4
privilege level 15
no login
!
no scheduler allocate
end
-------------------------------------------------------------------------------
ISP1#show running-config
Building configuration…
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname ISP1
!
ip subnet-zero
no ip domain-lookup
!
interface Loopback0
ip address 1.0.0.1 255.0.0.0
no ip directed-broadcast
!
interface Serial0/1
ip address 192.168.1.5 255.255.255.252
no ip directed-broadcast
!
router bgp 200
network 1.0.0.0
neighbor 192.168.1.6 remote-as 100
!
ip classless
!
line con 0
logging synchronous
transport input none
line aux 0
line vty 0 4
privilege level 15
no login
!
no scheduler allocate
end
-------------------------------------------------------------------------------
ISP2#show running-config
Building configuration...
Current configuration : 1005 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname ISP2
!
ip subnet-zero
!
no ip domain-lookup
!
interface Loopback0
ip address 3.0.0.1 255.0.0.0
!
interface Serial0/1
ip address 172.24.1.18 255.255.255.252
!
router bgp 300
bgp log-neighbor-changes
network 3.0.0.0
neighbor 172.24.1.17 remote-as 100
!
ip classless
no ip http server
!
line con 0
logging synchronous
transport input none
line aux 0
line vty 0 4
privilege level 15
no login
!
no scheduler allocate
end