74. Configure BGP Singlehomed

Опубликовано: 05 Август 2026
на канале: ITProDan
55
1

Border Gateway Protocol (BGP)
routing protocol
type of EGP (External Gateway Protocol)
routing protocol of the internet
implemented to a network when having an internal resources/servers that needs to be accessible all the time via the internet with redundancy
uses Path Attributes (PA) for best path determination equivalent to Metrics of IGP protocols
List of BGP PA:
Origin
AS_Path
Next_Hope
Local_Pref
Atomic_Aggregate
Aggregator
Community
Multi_Exit_Disc (MED)
Originator_ID
Cluster List
Multiprotocol Reachable NLRI
Multiprotocol Unreachable NLRI

BGP Types:
a. iBGP
BGP Routing within the same Autonomous System

b. eBGP
BGP Routing within different Autonomous Systems

BGP Design Topologies
a. Singlehomed
single link per ISP. 1 ISP
b. Dualhomed
2 links per ISP. 1 ISP
c. Single Multihomed
1 link per ISP. 2 or more ISP
d. Dual Multihomed
2 links per ISP. 2 or more ISP

How do BGP router establish neighbor relationships?
1. router tries to establish a TCP connection using port 179.
2. once the 3 way handshake completes, BGP sends its first packet called "BGP Open Message" equivalent to a hello message in IGPs
3. if all parameters are ok and verified, the 2 routers would then become neighbors, and will now be in the "Established" state.

BGP Neighbor States
a. Idle
BGP is administratively down, or is waiting for the next attempt
b. Connect
BGP is waiting for the tcp connection to be completed
3 way handshake sate
c. active
router trying to establish a TCP session but fails
router willtry to re-establish TCP connection in this state
d. Opensent
TCP connection okay
BGP Open message has been sent, but neighbor open message has not been received yet
e. Openconfirm
open message are both sent and received
waiting for a BGP keepalive message to check if there are neighbor parameter mismatch
f. Established
all neighbor parameters match, the neighbor relationship works and the BGP peers
can now exchange BG updates

BGP Configuration (SingleHomed)

1. establish the neighbor relationship
Syntax:
conf t
router bgp (local as#)
neighbor (ip address) remote0as (as # neighbor)

2. advertise the public networks
Syntax:
conf t
router bgp (local as #)
network (network addr) mask (subnet mask)
exit



Actual Configuration:

E1:
debug ip bgp //show status on cli real-time
conf t
router bgp 10
neighbor 185.32.40.201 remote-as 20
exit
show ip bgp summary //check bgp details/status
undebug all //to stop dugging
conf t
router bgp 10
network 185.32.40.80 mask 255.255.255.248 //advertise only the public IP
exit
ip route 185.32.40.80 255.255.255.248 null0 //create a discard route needed
show ip bgp //to show bgp advertise networks
conf t
router eigrp 10
redistribute bgp 10 metric 1544 100 255 1 1500 //redistribute bgp learned networks
exit


ISP1:
debug ip bgp //show status on cli realtime
conf t
router bgp 20
neighbor 185.32.40.202 remote-as 10
exit
show ip bgp summary //check bgp details/status
undebug all //to stop dugging
conf t
router bgp 20
network 0.0.0.0 mask 0.0.0.0 //default route advertise going to E1
exit
ip route 0.0.0.0 0.0.0.0 null0 //create a discard route needed