You are on page 1of 43

BGP

4-1
Copyright 2005 Juniper Networks, Inc.

Proprietary and Confidential

www.juniper.net

BGP Operation
BGP stores routes in three main routing information
base (RIB) memory tables

Adjacency-RIB-IN: Contains all received routes from each


peer
RIB-LOCAL: Contains routes the local router uses to forward
traffic
Adjacency-RIB-OUT: Contains all advertised routes sent to
each peer

Only active BGP routes in the local routing table can


be advertised to peers
Single, best BGP path is advertised
Can use advertise-inactive when BGP route is not
active, but only the single, best, inactive BGP path is
advertised

2008 Juniper Networks, Inc. All rights reserved.

BGP Update Message


Advertised and withdrawn routes are sent in an
update message to established peers
Common BGP header fields:
(16-byte) Marker
(2-byte) Length
(1-byte) Type

Update message fields:


(2-byte) Unfeasible routes length
(Variable) Withdrawn routes
(2-byte) Total path attributes length
(Variable) Path attributes
(Variable) Network layer reachability information

2008 Juniper Networks, Inc. All rights reserved.

Local Preference
Often used to set the exit point from an autonomous
system
Only exchanged within the confines of a single AS
(1-byte) Attribute type
(Variable) Attribute length
(4-byte) Local preference value

2008 Juniper Networks, Inc. All rights reserved.

AS Path
Collection of autonomous system numbers through
which the route has passed
Used to prevent routing loops
Used to select an active BGP path
(2-byte) Attribute type
(Variable) Attribute length
(Variable) AS path segments

2008 Juniper Networks, Inc. All rights reserved.

Origin
Measure of believability set by the originating BGP
router
Internal (0) > External (1) > Incomplete (2)
JUNOS software sets all injected routes to Internal
(2-byte) Attribute type
(1-byte) Attribute length
(1-byte) Origin

2008 Juniper Networks, Inc. All rights reserved.

Multiple Exit Discriminator


Often used to set an incoming entry point for an AS
Never passed through one AS to another AS
Can be translated from IGP metric
(2-byte) Attribute type
(1-byte) Attribute length
(4-byte) Multiple exit discriminator

2008 Juniper Networks, Inc. All rights reserved.

BGP Path Selection Process (1 of 2)


Steps:
1. Can the BGP next hop be reached?
If yes, proceed
If no, stop processing
2. Prefer the highest local preference value
3. Prefer the shortest AS path length
4. Prefer the lowest origin value

5. Prefer the lowest MED value


6. Prefer paths learned via EBGP over routes learned via IBGP

2008 Juniper Networks, Inc. All rights reserved.

BGP Path Selection Process (2 of 2)


7. Prefer paths with the lowest IGP metric. Select a physical next
hop (or hops) for each peer
a. Examine routing tables inet.0 and inet.3 for the BGP next hop.
Install the physical next hop(s) for the route with the better preference
b. In the event of a preference tie, install the physical next hop(s) found
in inet.3
c. For preference ties within the same routing table, install the physical
next hop(s) where the greater number of equal-cost paths exist

8. Prefer paths with the shortest cluster list length


9. Prefer paths from the peer with the lowest RID
a. When routes from different AS are equal up to the RID comparison
stage, prefer currently active route

10.Prefer paths from the peer with the lowest peer ID

2008 Juniper Networks, Inc. All rights reserved.

Local Preference Selection


user@host> show route 192.168.48/24 detail
inet.0: 52 destinations, 94 routes (52 active, 0 holddown, 0 hidden)
192.168.48.0/24 (3 entries, 1 announced)
*BGP
Preference: 170/-201
Source: 192.168.32.1
Next hop: 10.222.28.2 via fe-0/0/0.0, selected
Protocol next hop: 192.168.32.1 Indirect next hop: 858b4e0 73
State: <Active Int Ext>
Local AS: 65432 Peer AS: 65432
Age: 18:57
Metric2: 3
Task: BGP_65432.192.168.32.1+1042
AS path: 65000 I
Localpref: 200
Router ID: 192.168.32.1
BGP
Preference: 170/-101
Source: 10.222.29.2
Next hop: 10.222.29.2 via ge-0/1/0.0, selected
State: <Ext>
Inactive reason: Local Preference
Local AS: 65432 Peer AS: 65000
Age: 19:09
Task: BGP_65000.10.222.29.2+1061
AS path: 65000 I
---(more)---

2008 Juniper Networks, Inc. All rights reserved.

10

AS Path Selection
user@host> show route 192.168.48/24 detail
inet.0: 52 destinations, 94 routes (52 active, 0 holddown, 0 hidden)
192.168.48.0/24 (3 entries, 1 announced)
*BGP
Preference: 170/-101
Source: 192.168.16.1
Next hop: 10.222.44.1 via fe-0/0/0.0, selected
Protocol next hop: 192.168.16.1 Indirect next hop: 85d8270 46
State: <Active Int Ext>
Local AS: 65432 Peer AS: 65432
Age: 3:41
Metric2: 3
Task: BGP_65432.192.168.16.1+179
AS path: 65000 I
Localpref: 100
Router ID: 192.168.16.1
BGP
Preference: 170/-101
Source: 10.222.45.1
Next hop: 10.222.45.1 via so-0/3/0.0, selected
State: <Ext>
Inactive reason: AS path
Local AS: 65432 Peer AS: 65000
Age: 25
Task: BGP_65000.10.222.45.1+1064
AS path: 65000 65000 65000 I
---(more)---

2008 Juniper Networks, Inc. All rights reserved.

11

Origin Selection
user@host> show route 192.168.48/24 detail
inet.0: 52 destinations, 74 routes (52 active, 0 holddown, 0 hidden)
192.168.48.0/24 (2 entries, 1 announced)
*BGP
Preference: 170/-101
Source: 10.222.6.1
Next hop: 10.222.6.1 via fe-0/0/1.0, selected
State: <Active Ext>
Local AS: 65432 Peer AS: 65000
Age: 1:29
Metric: 20
Task: BGP_65000.10.222.6.1+1084
AS path: 65000 I
Localpref: 100
Router ID: 192.168.48.1
BGP
Preference: 170/-101
Source: 10.222.45.1
Next hop: 10.222.45.1 via so-0/3/0.0, selected
State: <Ext>
Inactive reason: Origin
Local AS: 65432 Peer AS: 65000
Age: 53
Task: BGP_65000.10.222.45.1+1064
AS path: 65000 ?
Localpref: 100
---(more)---

2008 Juniper Networks, Inc. All rights reserved.

12

MED Selection
user@host> show route 192.168.48/24 detail
inet.0: 52 destinations, 94 routes (52 active, 0 holddown, 0 hidden)
192.168.48.0/24 (3 entries, 1 announced)
*BGP
Preference: 170/-101
Source: 192.168.16.1
Next hop: 10.222.44.1 via fe-0/0/0.0, selected
Protocol next hop: 192.168.16.1 Indirect next hop: 85d8270 46
State: <Active Int Ext>
Local AS: 65432 Peer AS: 65432
Age: 9:53
Metric: 5
Metric2: 3
Task: BGP_65432.192.168.16.1+179
AS path: 65000 I
Localpref: 100
Router ID: 192.168.16.1
BGP
Preference: 170/-101
Source: 10.222.45.1
Next hop: 10.222.45.1 via so-0/3/0.0, selected
State: <NotBest Ext>
Inactive reason: Not Best in its group
Local AS: 65432 Peer AS: 65000
Age: 2:21
Metric: 20
Task: BGP_65000.10.222.45.1+1064
AS path: 65000 I
---(more)---

2008 Juniper Networks, Inc. All rights reserved.

13

EBGP over IBGP Selection


user@host> show route 192.168.48/24 detail
inet.0: 52 destinations, 73 routes (52 active, 0 holddown, 0 hidden)
192.168.48.0/24 (2 entries, 1 announced)
*BGP
Preference: 170/-101
Source: 10.222.5.2
Next hop: 10.222.5.2 via fe-0/0/2.0, selected
State: <Active Ext>
Local AS: 65432 Peer AS: 65000
Age: 2:18
Task: BGP_65000.10.222.5.2+1067
AS path: 65000 I
Localpref: 100
Router ID: 192.168.52.1
BGP
Preference: 170/-101
Source: 192.168.32.1
Next hop: 10.222.28.2 via fe-0/0/0.0, selected
Protocol next hop: 192.168.32.1 Indirect next hop: 858b4e0 73
State: <NotBest Int Ext>
Inactive reason: Interior > Exterior > Exterior via Interior
Local AS: 65432 Peer AS: 65432
Age: 5:25
Metric2: 3
Task: BGP_65432.192.168.32.1+1042
AS path: 65000 I
---(more)---

2008 Juniper Networks, Inc. All rights reserved.

14

IGP Cost Selection


user@host> show route 192.168.48/24 detail
inet.0: 49 destinations, 69 routes (49 active, 0 holddown, 0 hidden)
192.168.48.0/24 (2 entries, 1 announced)
*BGP
Preference: 170/-101
Source: 192.168.16.1
Next hop: 10.222.28.1 via fe-0/0/0.0, selected
Protocol next hop: 192.168.16.1 Indirect next hop: 85d61d4 41
State: <Active Int Ext>
Local AS: 65432 Peer AS: 65432
Age: 12
Metric2: 1
Task: BGP_65432.192.168.16.1+1126
AS path: 65000 I
Localpref: 100
Router ID: 192.168.16.1
BGP
Preference: 170/-101
Source: 192.168.32.1
Next hop: 10.222.4.2 via fe-0/0/1.0, selected
Protocol next hop: 192.168.32.1 Indirect next hop: 85d630c 44
State: <NotBest Int Ext>
Inactive reason: IGP metric
Local AS: 65432 Peer AS: 65432
Age: 3:19
Metric2: 2
Task: BGP_65432.192.168.32.1+1045
---(more)---

2008 Juniper Networks, Inc. All rights reserved.

15

Cluster List Length Selection


user@host> show route 192.168.16/24 detail
inet.0: 42 destinations, 47 routes (42 active, 0 holddown, 0 hidden)
192.168.16.0/24 (2 entries, 1 announced)
*BGP
Preference: 170/-101
Next hop: 10.222.44.1 via fe-0/0/0.0, selected
Protocol next hop: 192.168.24.1 Indirect next hop: 85d8270 70
State: <Active Int Ext>
Local AS: 65000 Peer AS: 65000
Age: 6:41
Metric: 20
Metric2: 3
AS path: 65432 I (Originator) Cluster list: 3.3.3.3
AS path: Originator ID: 192.168.24.1
Localpref: 100
Router ID: 192.168.36.1
BGP
Preference: 170/-101
Next hop: 10.222.6.1 via fe-0/0/1.0, selected
Protocol next hop: 192.168.20.1 Indirect next hop: 85d83a8 72
State: <NotBest Int Ext>
Inactive reason: Cluster list length
Local AS: 65000 Peer AS: 65000
Age: 1:13
Metric: 20
Metric2: 3
AS path: 65432 I (Originator) Cluster list: 2.2.2.2 1.1.1.1
AS path: Originator ID: 192.168.20.1
Localpref: 100
Router ID: 192.168.48.1

2008 Juniper Networks, Inc. All rights reserved.

16

Router ID Selection
user@host> show route 192.168.48/24 detail
inet.0: 52 destinations, 94 routes (52 active, 0 holddown, 0 hidden)
192.168.48.0/24 (3 entries, 1 announced)
*BGP
Preference: 170/-101
Source: 10.222.29.2
Next hop: 10.222.29.2 via ge-0/1/0.0, selected
State: <Active Ext>
Local AS: 65432 Peer AS: 65000
Age: 10
Task: BGP_65000.10.222.29.2+179
AS path: 65000 I
Localpref: 100
Router ID: 192.168.20.1
BGP
Preference: 170/-101
Source: 10.222.5.2
Next hop: 10.222.5.2 via fe-0/0/2.0, selected
State: <NotBest Ext>
Inactive reason: Router ID
Local AS: 65432 Peer AS: 65000
Task: BGP_65000.10.222.5.2+1067
AS path: 65000 I
Localpref: 100
Router ID: 192.168.52.1
---(more 66%)---

2008 Juniper Networks, Inc. All rights reserved.

17

Peer ID Selection
user@host> show route 192.168.48/24 detail
inet.0: 64 destinations, 106 routes (64 active, 0 holddown, 0 hidden)
192.168.48.0/24 (3 entries, 1 announced)
*BGP
Preference: 170/-101
Source: 10.222.5.2
Next hop: 10.222.5.2 via fe-0/0/2.0, selected
State: <Active Ext>
Local AS: 65432 Peer AS: 65000
Age: 30
Task: BGP_65000.10.222.5.2+1073
AS path: 65000 I
Localpref: 100
Router ID: 192.168.52.1
BGP
Preference: 170/-101
Source: 10.222.15.2
Next hop: 10.222.15.2 via fe-0/0/2.1, selected
State: <NotBest Ext>
Inactive reason: Update source
Local AS: 65432 Peer AS: 65000
Task: BGP_65000.10.222.15.2+179
AS path: 65000 I
Localpref: 100
Router ID: 192.168.52.1
---(more 51%)---

2008 Juniper Networks, Inc. All rights reserved.

18

Path Selection: Peer ID


Used when multiple BGP peering sessions exist
between two routers
Only one BGP session is used to forward traffic
ID is the physical IP address on the neighboring routers
interface
Los Angeles

10.10.1.2/24

10.10.1.1/24

(AS1)

10.10.2.2/24

10.10.2.1/24

Las Vegas
(AS2)

[edit protocols bgp group ext-peers]


type external;
peer-as 2;
neighbor 10.10.1.1;
neighbor 10.10.2.1;
}
2008 Juniper Networks, Inc. All rights reserved.

19

BGP Multipath (1 of 3)
BGP can ignore both router ID and peer ID
comparisons when multipath is configured within
BGP
Can use:

Two peering sessions to the same router


Two peering sessions to different routers in the same AS

Los Angeles
(AS1)

10.222.28.1/24

10.222.29.1/24

[edit protocols bgp group ext-peers]


type external;
peer-as 2;
neighbor 10.222.28.2;
neighbor 10.222.29.2;
}
user@host> show bgp summary
Peer
AS
InPkt
OutPkt
10.222.28.2
2
7
7
10.222.29.2
2
8
10
2008 Juniper Networks, Inc. All rights reserved.

10.222.28.2/24

Las Vegas

(AS2)
Reno
10.222.29.2/24

OutQ
0
0

(AS2)

Flaps Last Up/Dwn State|#Active/Rec


0
00:00:02 4/4/0
0
00:00:06 0/4/0
20

BGP Multipath (2 of 3)
Routes from each peer contain a single next hop
user@host> show route protocol bgp terse
inet.0: 15 destinations, 19 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

A Destination

P Prf

Metric 1

* 172.16.20.4/30

B 170

100

>10.222.28.2

2 I

B 170

100

>10.222.29.2

2 I

B 170

100

>10.222.28.2

2 I

B 170

100

>10.222.29.2

2 I

B 170

100

>10.222.28.2

2 I

B 170

100

>10.222.29.2

2 I

B 170

100

>10.222.28.2

2 I

B 170

100

>10.222.29.2

2 I

* 172.16.20.8/30

* 172.16.20.12/30

* 172.16.20.16/30

2008 Juniper Networks, Inc. All rights reserved.

Metric 2

Next hop

AS path

21

BGP Multipath (3 of 3)
Peer group on Los Angeles configured with
multipath
Active route receives two next hops
Forwarding table still maintains a single next hop per route
user@host> show route protocol bgp terse
inet.0: 15 destinations, 19 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
A Destination
* 172.16.20.4/30

P Prf
B 170

Metric 1
100

* 172.16.20.8/30

B 170
B 170

100
100

* 172.16.20.12/30

B 170
B 170

100
100

* 172.16.20.16/30

B 170
B 170

100
100

B 170

100

2008 Juniper Networks, Inc. All rights reserved.

Metric 2

Next hop
>10.222.28.2
10.222.29.2
>10.222.29.2
>10.222.28.2
10.222.29.2
>10.222.29.2
>10.222.28.2
10.222.29.2
>10.222.29.2
10.222.28.2
>10.222.29.2
>10.222.29.2

AS path
2 I
2 I
2 I

2 I
2 I
2 I
2 I

2 I

22

Multihop Peering
EBGP sessions can peer with nonphysical addresses
lo0: 192.168.3.4

lo0: 172.16.128.1

Los Angeles

10.10.1.2/24

10.10.1.1/24

(AS1)

10.10.2.2/24

10.10.2.1/24

Las Vegas
(AS2)

[edit protocols bgp group ext-peers]


type external;
Step 1
local-address 192.168.3.4;
neighbor 172.16.128.1 {
A TTL value of 1 accommodates peering to
Step
2
multihop ttl 1;
a loopback address on a directly
connected peerhigher values are needed
}
for peers that are not directly connected
[edit routing-options]
static {
Step 3
route 172.16.128.1 next-hop [ 10.10.1.1 10.10.2.1 ];
}

2008 Juniper Networks, Inc. All rights reserved.

23

Multiple Next Hops


Both multihop and multipath create routes with
multiple next hops in the routing table
Use a routing policy to forward traffic on both next hops
user@host> show route 172.16.20.4/30 terse
inet.0: 15 destinations, 19 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
A Destination
* 172.16.20.4/30

P Prf
B 170

Metric 1
100

B 170

100

Metric 2

user@host> show route forwarding-table matching


Routing table: inet
Internet:
Destination
Type RtRef Next hop
172.16.20.4/30
user
0
10.10.1.1

2008 Juniper Networks, Inc. All rights reserved.

Next hop
>10.10.1.1
10.10.2.1
>10.10.2.1

AS path
2 I
2 I

172.16.20.4/30

Type Index NhRef Netif


indr
106
4
ucst
47
4 fe-0/0/0.0

24

Load Balancing
user@host> show configuration policy-options policy-statement load-balance
then {
load-balance per-packet;
}
user@host> show configuration routing-options forwarding-table
export load-balance;
user@host> show route 172.16.20.4/30 terse
inet.0: 15 destinations, 19 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
A Destination
* 172.16.20.4/30

P Prf
B 170

Metric 1
100

B 170

100

Metric 2

Next hop
>10.10.1.1
10.10.2.1
>10.10.2.1

AS path
2 I
2 I

user@host> show route forwarding-table matching 172.16.20.4/30


Routing table: inet
Internet:
Destination
Type RtRef Next hop
Type Index NhRef Netif
172.16.20.4/30
user
0
ulst
108
4
indr
106
2
10.10.1.1
ucst
47
4 fe-0/0/0.0
indr
107
2
10.10.2.1
ucst
99
4 ge-0/1/0.0

2008 Juniper Networks, Inc. All rights reserved.

25

Multihop with No Next-Hop Change (1 of 4)


AS 65001 and 65002 wants to use MPLS for
forwarding user traffic
LSP from Hong Kong to Amsterdam is one example

The 172.16.1.0/24 route is advertised into AS 65002


by an EBGP peer
172.16.1.0/24
via EBGP

AS 65001

AS 65002
LSP

Hong Kong
192.168.16.1

2008 Juniper Networks, Inc. All rights reserved.

San Jose
192.168.20.1

Montreal
192.168.40.1

Amsterdam
192.168.32.1

26

Multihop with No Next-Hop Change (2 of 4)


The 172.16.1.0/24 route currently does not use the
LSP to Amsterdam
BGP next hop is not in the inet.3 routing table
lab@HongKong> show route table inet.3
inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.32.1/32

*[RSVP/7] 00:14:02, metric 0


> to 10.222.29.2 via ge-0/1/0.0, label-switched-path HK-to-Amsterdam

lab@HongKong> show route 172.16/16 detail


inet.0: 14 destinations, 16 routes (14 active, 0 holddown, 0 hidden)
172.16.1.0/24 (1 entry, 1 announced)
*BGP
Preference: 170/-101
Source: 192.168.20.1
Next hop: 10.222.29.2 via ge-0/1/0.0, selected
Protocol next hop: 192.168.40.1 Indirect next hop: 858709c 119
State: <Active Int Ext>
Local AS: 65001 Peer AS: 65001
Age: 26:02
Metric2: 0
Task: BGP_65001.192.168.20.1+3187
Announcement bits (2): 0-KRT 2-Resolve inet.0
AS path: 65002 65003 I
Localpref: 100
Router ID: 192.168.20.1

2008 Juniper Networks, Inc. All rights reserved.

27

Multihop with No Next-Hop Change (3 of 4)


EBGP peers alter the BGP next hop across AS
boundaries
The show route advertising-protocol bgp
command has a next-hop value of self

If you use multihop and the keyword, no-nexthopchange, you can change default
The next-hop value is the address of the IBGP peer that first
advertised the route
user@Montreal> show route advertising-protocol bgp 192.168.20.1
inet.0: 14 destinations, 16 routes (14 active, 0 holddown, 1 hidden)
Prefix
Nexthop
MED
Lclpref
AS path
* 172.16.1.0/24
Self
65003 I
[edit protocols bgp group ext-peers]
user@Montreal# set neighbor 192.168.20.1 multihop no-nexthop-change
user@Montreal> show route advertising-protocol bgp 192.168.20.1
inet.0: 14 destinations, 16 routes (14 active, 0 holddown, 1 hidden)
Prefix
Nexthop
MED
Lclpref
AS path
* 172.16.1.0/24
192.168.32.1
65003 I
2008 Juniper Networks, Inc. All rights reserved.

28

Multihop with No Next-Hop Change (4 of 4)


User traffic uses the LSP to reach 172.16.1.0/24
user@HongKong> show route table inet.3
inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.32.1/32

*[RSVP/7] 01:21:26, metric 0


> to 10.222.29.2 via ge-0/1/0.0, label-switched-path HK-to-Amsterdam

user@HongKong> show route 172.16/16


inet.0: 14 destinations, 16 routes (14 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
172.16.1.0/24

*[BGP/170] 01:33:20, localpref 100, from 192.168.20.1


AS path: 65002 65003 I
> to 10.222.29.2 via ge-0/1/0.0, label-switched-path HK-to-Amsterdam

user@HongKong> traceroute 172.16.1.1 source 192.168.16.1


traceroute to 172.16.1.1 (172.16.1.1) from 192.168.16.1, 30 hops max, 40 byte packets
1 10.222.29.2 (10.222.29.2) 1.114 ms 0.913 ms 0.831 ms
MPLS Label=100010 CoS=0 TTL=1 S=1
2 10.222.1.2 (10.222.1.2) 0.916 ms 0.868 ms 0.851 ms
MPLS Label=100008 CoS=0 TTL=1 S=1
3 10.222.45.2 (10.222.45.2) 0.682 ms 0.687 ms 0.641 ms
4 10.222.6.1 (10.222.6.1) 0.734 ms 0.739 ms 0.690 ms

2008 Juniper Networks, Inc. All rights reserved.

29

Peer Configuration Options (1 of 3)


passive keeps BGP from sending open message
[edit protocols bgp]
group ext-peers {
type external;
peer-as 2;
neighbor 10.10.10.1 {
passive;
}
}

allow accepts open messages from any peer within


the configured IP address range
[edit protocols bgp]
group ext-peers {
type external;
peer-as 65000;
allow 10.10/16;
}

Can enable MD5 authentication


[edit protocols bgp]
group ext-peers {
type external;
peer-as 2;
neighbor 10.10.10.1 {
authentication-key $9$.mQn/9pBRSAp7VYojiAp0O1h;
}
}
2008 Juniper Networks, Inc. All rights reserved.

30

Peer Configuration Options (2 of 3)


prefix-limit allows a specified amount of
prefixes to be received
[edit protocols bgp]
group ext-peers {
type external;
peer-as 2;
family inet {
unicast {
prefix-limit {
maximum 25000;
teardown 80 idle-timeout 10;
}
}
}
neighbor 10.10.10.1;
}

hold-time alters the value used in the session


negotiation process
[edit protocols bgp]
group ext-peers {
type external;
hold-time 45;
peer-as 2;
neighbor 10.10.10.1;
}

2008 Juniper Networks, Inc. All rights reserved.

31

Peer Configuration Options (3 of 3)


advertise-peer-as disables suppression of route
advertisements
Routes learned from an EBGP peer are advertised back to
the same EBGP peer
Routes learned from an EBGP peer are advertised to EBGP
peers in the same AS as the originating peer
[edit protocols bgp]
group ext-peers {
advertise-peer-as;
peer-as 2;
neighbor 10.10.10.1;
}

2008 Juniper Networks, Inc. All rights reserved.

32

Graceful Restart
A BGP router can negotiate with peers to maintain its
announced routes during a restart
Neighbors continue forwarding traffic to the router
Neighbors do not withdraw the routes of the restarting router

End-of-RIB markers sent for each NLRI


Notifies the neighbor that all current routing information was
sent
Local router defers path selection algorithm until the marker
is received

Configured globally within [edit routingoptions]

2008 Juniper Networks, Inc. All rights reserved.

33

Modifying Local Preference


AS 65002

AS 65003

192.168.19.0/24

local-preference
user@host> show route advertising-protocol bgp 192.168.40.1
inet.0: 14 destinations, 15 routes (14 active, 0 holddown, 0 hidden)
Restart Complete
Prefix
Nexthop
MED
Lclpref
AS path
* 192.168.19.0/24
Self
0
100
65003 I
[edit]
user@host# set protocols bgp group int-peers local-preference 300

user@host> show route advertising-protocol bgp 192.168.40.1


inet.0: 14 destinations, 15 routes (14 active, 0 holddown, 0 hidden)
Restart Complete
Prefix
Nexthop
MED
Lclpref
AS path
* 192.168.19.0/24
Self
0
300
65003 I

2008 Juniper Networks, Inc. All rights reserved.

34

Modifying AS Path: remove-private


192.168.17.0/24: 1000
192.168.18.0/24: 1000

192.168.19.0/24: 1000

remove-private

AS 1000

192.168.17.0/24: 65001

192.168.18.0/24: 65002

192.168.19.0/24: 65003

AS 65001

AS 65002

AS 65003

192.168.17.0/24

192.168.18.0/24

192.168.19.0/24

2008 Juniper Networks, Inc. All rights reserved.

35

Modifying AS Path: local-as (1 of 3)

172.16.10.0/24: 1 222

Internet

172.16.12.0/24: 1 333

AS 1

172.16.10.0/24: 222

AS 222
172.16.10.0/24

2008 Juniper Networks, Inc. All rights reserved.

172.16.12.0/24: 333
AS 333
172.16.12.0/24

36

Modifying AS Path: local-as (2 of 3)


AS 777
172.16.10.0/24: 1 222
172.16.12.0/24: 1 333

172.16.10.0/24: 777 1 222

172.16.12.0/24: 777 1 333


local-as 1

172.16.10.0/24: 222

Internet
172.16.12.0/24: 333

AS 222

AS 333

172.16.10.0/24

172.16.12.0/24

2008 Juniper Networks, Inc. All rights reserved.

37

Modifying AS Path: local-as (3 of 3)


AS 777
172.16.10.0/24: 222
172.16.12.0/24: 333

172.16.10.0/24: 777 222


172.16.12.0/24: 777 333

local-as 1 private

172.16.10.0/24: 222

Internet
172.16.12.0/24: 333

AS 222

AS 333

172.16.10.0/24

172.16.12.0/24

2008 Juniper Networks, Inc. All rights reserved.

38

Modifying AS Path: as-override


172.16.10.0/24: 65022

172.16.10.0/24: 65432 65432


10.222.4.2

AS 65022

AS 65022

10.222.4.1

172.16.10.0/24
AS 65432

as-override
user@AS65432> show route advertising-protocol bgp 10.222.4.2
inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
Prefix
Nexthop
MED
Lclpref
* 172.16.10.0/24
Self

AS path
65022 I

user@AS65022> show route receive-protocol bgp 10.222.4.1


inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
[edit]
user@AS65432# set protocols bgp group AS-65022 as-override
user@AS65432> show route advertising-protocol bgp 10.222.4.2
inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
Prefix
Nexthop
MED
Lclpref
* 172.16.10.0/24
Self

AS path
65022 I

user@AS65022> show route receive-protocol bgp 10.222.4.1


inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
Prefix
Nexthop
MED
Lclpref
* 172.16.10.0/24
10.222.4.1

AS path
65432 65432 I

2008 Juniper Networks, Inc. All rights reserved.

39

Modifying AS Path: loops


172.16.10.0/24: 65022

AS 65022
172.16.10.0/24

172.16.10.0/24: 65432 65022

AS 65432
AS 65022

user@AS65022> show route receive-protocol bgp 10.222.4.1

inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)

[edit]
user@AS65022# set routing-options autonomous-system 65022 loops 2

user@AS65022> show route receive-protocol bgp 10.222.4.1


inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
Prefix
Nexthop
MED
Lclpref
* 172.16.10.0/24
10.222.4.1

2008 Juniper Networks, Inc. All rights reserved.

AS path
65432 65022 I

40

Coordinating MED and IGP Metrics


Use the metric-out command with a group or
neighbor
Can be set to:
A specific value
The current IGP metric
The minimum IGP metric ever learned

Can add to or subtract from the IGP metric


[edit protocols bgp]
group as-100-peers {
type external;
peer-as 100;
neighbor 192.168.2.2
neighbor 192.168.3.3
neighbor 192.168.4.4
neighbor 192.168.5.5
}
2008 Juniper Networks, Inc. All rights reserved.

metric-out
metric-out
metric-out
metric-out

10;
igp;
minimum-igp;
igp 5;

41

Path Selection and MEDs


By default, the JUNOS software uses a deterministic
MED comparison scheme for routes from the same AS
always-compare-med compares MED values,
regardless of whether the neighboring AS is the same
Use with cautionevery network has a different
interpretation of a good MED

cisco-non-deterministic compares paths


based on when they are received
Not recommended for use in your network
Can cause incorrect route selections
[edit]
user@host# set protocols bgp path-selection ?
Possible completions:
always-compare-med
Always compare MED values, regardless of neighbor AS
cisco-non-deterministic Use Cisco IOS nondeterministic path selection algorithm

2008 Juniper Networks, Inc. All rights reserved.

42

You might also like