Weight
- Weight attribute influence on a router.
- Weight HIGHEST is chosen.
- Setting on decision router's inbound interface.
R1#show ip bgp
BGP table version is 2, local router ID is 192.168.13.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
* 2.2.2.0/24 192.168.13.3 0 200 2 i
*> 192.168.12.2 0 300 2 i
R1#
*Oct 20 16:14:00.631: %BGP-5-ADJCHANGE: neighbor 192.168.12.2 Up
*Oct 20 16:14:00.753: %BGP-5-ADJCHANGE: neighbor 192.168.13.3 Up
Local Preference
- Local Preference influence to all routers in an AS.
- Local Preference HIGHEST is chosen.
- Setting on decision router's inbound interface.
R4#show ip bgp
BGP table version is 3, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.0/24 3.3.3.3 0 600 0 1 i
* i 2.2.2.2 0 100 0 1 i
AS Path
- AS Path prepending influence to Next Hop router.
- AS Path LOWEST is chosen.
- Setting AS Path prepending policy on decision router's outbound interface.
R2#show ip bgp
BGP table version is 2, local router ID is 192.168.23.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
* 1.1.1.0/24 192.168.12.1 0 0 1 1 1 1 1 1 i
*> 192.168.23.3 0 0 1 i
Multi Exit Discriminator (MED)
- MED influence to all routers in remote AS, not forward to other AS.
- MED LOWEST is chosen.
- Setting MED policy on decision router's outbound interface.
R2#show ip bgp
BGP table version is 2, local router ID is 192.168.23.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
* 1.1.1.0/24 192.168.12.1 700 0 1 i
*> 192.168.23.3 500 0 1 i
Take a close look at the second command, we have to use the neighbor send-community command because the router doesn't automatically send BGP communities to its neighbors
Internet
- When we want to advertise all prefixes to BGP neighbors.
No-Advertise
- When we don't want a BGP neighbor advertise any prefix to others.
- Setting No-Advertise policy on decision router's outbound interface.
R2#show ip bgp
*> 1.1.1.1/32 192.168.12.1 0 0 1 i
R2#show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table default)
Advertised to update-groups:
7 8
Refresh Epoch 1
1
192.168.12.1 from 192.168.12.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
R2#show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table default, not advertised to any peer)
Not advertised to any peer
Refresh Epoch 1
1
192.168.12.1 from 192.168.12.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: no-advertise
rx pathid: 0, tx pathid: 0x0
R2#show ip bgp neighbors 192.168.23.3 advertised-routes
Total number of prefixes 0
R2#show ip bgp neighbors 192.168.24.4 advertised-routes
Total number of prefixes 0
No-Export
- When we want to advertise prefixes to iBGP neighbors, but don't want to advertise to eBGP neighbors.
- Setting No-Export policy on decision router's outbound interface.
R2#show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 3
Paths: (1 available, best #1, table default, not advertised to EBGP peer)
Advertised to update-groups:
14
Refresh Epoch 1
1
192.168.12.1 from 192.168.12.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: no-export
rx pathid: 0, tx pathid: 0x0
R2#show ip bgp neighbors 192.168.24.4 advertised-routes
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 192.168.12.1 0 0 1 i
Total number of prefixes 1
R2#show ip bgp neighbors 192.168.23.3 advertised-routes
Total number of prefixes 0
Local-AS
- Local-AS is used in BGP Confederation.
- When we want to advertise prefixes to an sub-AS, but don't want to advertise to other sub-AS or AS.
- Setting Local-AS policy on decision router's inbound interface.
R2#show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table default, not advertised outside local AS)
Advertised to update-groups:
9
Refresh Epoch 2
1
192.168.12.1 from 192.168.12.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: local-AS
rx pathid: 0, tx pathid: 0x0
R3#show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 15
Paths: (1 available, best #1, table default, not advertised outside local AS)
Not advertised to any peer
Refresh Epoch 1
1
192.168.12.1 (metric 2) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, confed-internal, best
Community: local-AS
rx pathid: 0, tx pathid: 0x0
#Before setting Local-AS community.
R5# show ip bgp
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.1/32 192.168.12.1 0 100 0 (23) 1 i
* 192.168.12.1 0 100 0 (23) 1 i
*> 192.168.12.0 2.2.2.2 0 100 0 (23) i
#After setting Local-AS community.
R5# show ip bgp
Network Next Hop Metric LocPrf Weight Path
*>i 192.168.12.0 2.2.2.2 0 100 0 (23) i
* 2.2.2.2 0 100 0 (23) i
R6#show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 192.168.12.0 2.2.2.2 0 100 0 (23) i