Sunteți pe pagina 1din 93

Introduction to

Border Gateway
Protocol (BGP 4)

Version 1.2

Summary
BGP Concept
BGP Operation
Route

Control

Configuration
Trouble-shooting
Juniper

Updated

vs. Cisco
Juniper Networks, Inc. Copyright

Summary
BGP Concept
BGP Operation
Route

Control

Configuration
Trouble-shooting
Juniper

Updated

vs. Cisco

Juniper Networks, Inc. Copyright

Concepts

The BGP protocol was developed by the IDR Working Group


of IETF. A first version of BGP was published in June 1989
as RFC 1105 (BGP-1). A second version was published in
June 1990 as RFC 1163 (BGP-2). A third version was
published in October 1991 as RFC 1267 (BGP-3).

A fourth version was published in July 1994 as RFC 1654


(BGP-4). The Current version of BGP-4 is documented in
RFC 1771 (March 1995).

BGP-4 supports

the path vector concept to avoid the potential routing loop introduced by
complicated (I.e., full-meshed) Internet topology

IP prefix and length advertisements

Updated

Juniper Networks, Inc. Copyright

BGP Protocol Overview

JUNOS software supports BGP Version 4 and several extensions


to the protocol

RFC 1771, A Border Gateway Protocol 4 (BGP-4)


RFC 1772, Application of the Border Gateway Protocol in the Internet
RFC 1965, Autonomous System Confederations for BGP
RFC 1966, BGP Route Reflection: An Alternative to Full-Mesh IBGP
RFC 1997, BGP Communities Attribute
RFC 2270, Using a Dedicated AS for Sites Homed to a Single Provider
RFC 2283, Multiprotocol Extensions for BGP-4
RFC 2385, Protection of BGP Sessions via the TCP MD5 Signature
Option
RFC 2439, BGP Route Flap Damping
Capabilities Negotiation with BGP4, IETF draft draft-ietf-idr-cap-neg01
BGP Extended Communities Attribute, IETFdraft-ramachandra-bgpext-communities-04.txt

Updated

Juniper Networks, Inc. Copyright

Concepts

the concept of classless interdomain routing to allow better use of


existing IP address space and to minimize the rapid growth of
routing table size (CIDR, RFC 1519)

policy-based routing using a set of pre-defined path attributes

BGP-4 supports route aggregation and AS aggregation (I.e., AS


Set and Confederation)

fast convergence by requiring the router to inform its neighbors


when the previously announced routes become unreachable

large routing table size

authentication using BGP identifier and AS number. In addition, it


supports encrypted signature in every BGP message.

Updated

Juniper Networks, Inc. Copyright

Concepts

BGP routers only use those routes whose next-hop can be reached
BGP routers advertise only those routes that they use
BGP runs over a reliable transport protocol.

TCP port 179


takes care of segmenting, sequencing, retransmission and
acknowledgments
supports a "graceful" close, i.e., that all outstanding data will be delivered
before the connection is close.
4096 max frame size
hold time (90 sec def smallest used between peers)
open->updates->keepalives (steady state)-> notification
(close)
|
|
------ --- -------

BGP MIB consists of the BGP Peer Table, The BGP Path Attribute
Table and a Global Table.

Updated

Juniper Networks, Inc. Copyright

Concepts
Autonomous System (AS)

The classic definition of an Autonomous System is a set of routers


under a single technical administration, using a single IGP and
common metrics to route packets within the AS, and using an EGP
to route packets to other ASs.

Currently, it has become common for a single AS to use several


IGPs and sometimes several sets of metrics within an AS.

The use of the term Autonomous System here stresses the fact that,
even when multiple IGPs and metrics are used, the administration
of an AS appears to other ASs to have a single coherent interior
routing plan and presents a consistent picture of what
destinations are reachable through it.

Updated

Juniper Networks, Inc. Copyright

Concepts
Autonomous System Type
Stub AS
Single Exit Point
Local Traffic
Multi-Homed AS
Multiple Exit Points
Local Traffic
Transit AS
Local and Transit Traffic

BGP Peers

Provider "B"

Provider "A"

Transit AS
AS 60

Transit AS
AS 50

Customer #1
AS 100

TCP Connections

Stub As

Stub As

Customer #n
AS 120
EBGP
IBGP

Updated

Multi-Homed
Customer #2
AS 110

Juniper Networks, Inc. Copyright

BGP AS

What is an AS?
-16 bit integer (1-65535)
-64512-65535 private.

Updated

Juniper Networks, Inc. Copyright

10

Concepts
CIDR = Classless Inter Domain Routing
Address Assignment

and Aggregation Strategy

A mechanism

to aggregate IP addresses into blocks of


multiple of the old style classes of addresses

Reduces

routing information through this aggregation

Conserves

Resources

router resources (CPU, memory)


bandwidth (less routes -> less routing packets)

Updated

Juniper Networks, Inc. Copyright

11

Concepts
Supernet

Organizations
These

are allocated Blocks of IP addresses

blocks are allocated in powers of 2

The

Blocks of Address Space can be Aggregated into one


routing announcement (Supernetting)
Block

of 256 Class C Networks (or a class B sized block)

IP addresses
Can

be described by one Supernetted Route

192.24.0.0

Updated

192.24.0.0 thru 192.24.255.255


Mask 255.255.0.0

Juniper Networks, Inc. Copyright

12

Concepts
Exterior Routes
Routes

learned from other autonomous


systems

Updated

Juniper Networks, Inc. Copyright

13

Concepts
External Neighbor

Between BGP Speakers in


different AS
Should be directly connected
Configuration
Router A
bgp {
group EXTERNAL {
neighbor 1.1.1.2;
type external;
peer-as 200 ;
}
{

AS 100
A

.1
1.1.1.0
AS 200
.2

Router B
bgp {
group EXTERNAL {
neighbor 1.1.1.1;
type external;
peer-as 100 ;
}
{

Updated

Juniper Networks, Inc. Copyright

14

Concepts
Internal Neighbor

Neighbor in same AS
May be several hop away
Configuration
Router A
bgp {
group INTERNAL {
type internal;
neighbor 1.1.1.1;
}
}

AS 100

A
B

Router B
bgp {
group INTERNAL {
neighbor 2.2.2.2;
type internal;
}
{

Updated

Juniper Networks, Inc. Copyright

15

Concepts
Internal vs. External BGP

EBGP Update
Local Preference
Removed
MED
Removed the MED from
previous AS
Unchanged
Cluster list
Prepend the Cluster ID
by RR
Changed to the local address
Next-hop address
Preserved
Prepend the local AS
AS Path
Unchanged

Updated

IBGP Update
Preserved
Preserved

Juniper Networks, Inc. Copyright

16

BGP Attribute
Well-known mandatory Always present in a BGP
update. All BGP implementations recognize these
attributes. An example is the BGP next hop attribute.
(Origin, AsPath)
Well-known discretionary - Might be present in a BGP
update. All BGP implementations recognize these
attributes. An example is the local preference
attribute.
Optional transitive - Must be passed to other BGP peers
even if the local peer does not understand or process
the attribute. An example is the community attribute.
Optional non-transitive - Must not be passed to other
BGP peers. An example is the MED attribute

Updated

Juniper Networks, Inc. Copyright

17

Concepts
AS path Attributes

Standard attribute types

1, ORIGIN
2, AS_PATH
3, NEXT_HOP
4, MULTI_EXIT_DISC
5, LOCAL_PREF
6, ATOMIC_AGGREGATE
7, AGGREGATOR

(well-known mandatory)
(well-known mandatory)
(well-known mandatory)
(optional non-transitive)
(well-known discretionary)
(well-known discretionary)
(optional transitive)

Additional attribute types have been created via supplemental


specifications to extend the protocol

8, Community
9, Originator Id
10, Cluster list
11, Destination Path Attribute

Updated

(optional transitive)
(optional non-transitive)
(optional non-transitive)
(optional transitive)

Juniper Networks, Inc. Copyright

18

Concepts
AS-Path

Path traversed one or more


members of a set
{100 200} (as-set)

A list of ASs that a route has


traversed

100
143.89.14.0/24
206.161.46.0/24

200
206.161.47.0/24

300 100 (sequence)


300
210.168.35.0/24

143.89.14.0/24 300 100


210.168.35.0/24 300
206.161.46.0/23 300 {100 200}

Updated

Juniper Networks, Inc. Copyright

19

Concepts
Next-hop
set by EBGP speaker or policy

Next hop to reach a network


Router A will advertise 100.100.100.1 next hop for network 150.10.0.0
A

AS 109
150.10.0.0/16

100.100.100.0
.1
.2
AS 173
B

Updated

Juniper Networks, Inc. Copyright

20

Concepts
Next-hop Issue

Router B would advertise 100.100.100.3 as an next-hop to reach the


network behind router C to AS 109 ( router A )
Router A
AS 109
.1
EBGP
100.100.100.0/24
.2

.3

AS 173
Router B

Updated

Router C

Juniper Networks, Inc. Copyright

21

Concepts
Next-hop Issue

Problem will occur if the network in-between is actually an NBMA


network !
Router A
AS 109
.1
EBGP
100.100.100.0/24
.2

.3

AS 173
Router B

Updated

Router C

Juniper Networks, Inc. Copyright

22

Concepts
Next-hop Issue

Use next-hop self to solve


Router A

Router B:
protocol bgp {
group BGP-to-router-A {
export chg-nexthop;
}
EBGP
}
policy-options policy-statement chg-nexthop {
from protocol bgp;
then next-hop self;
AS 173
}

AS 109
.1
100.100.100.0/24
.2

Router B

Updated

Juniper Networks, Inc. Copyright

.3

Router C

23

Concepts
Local Preference
AS 200
AS 666

AS 180
Where to 200 ??

AS 173

Preference send to all routers in local AS


Path with highest preference value are most desirable

Updated

Juniper Networks, Inc. Copyright

24

Concepts
Local Preference
AS 200
AS 666

AS 180

bgp {
group EXTERNAL {
type external;
peer-as 666
local-preference 100;
neighbor 1.1.1.1;
}
}

Updated

AS 173

Juniper Networks, Inc. Copyright

25

Concepts
Multi-Exit Discriminator (MED)
32-bit, non-negative
Affects

all routes from same AS path

Advertised
Lower

Updated

to external neighbors

MED value is more preferable

Juniper Networks, Inc. Copyright

26

Concepts
Multi-Exit Discriminator (MED)
AS 666

AS 200

AS 1800
AS 1988
AS 2000
AS 173

Updated

Applies on a AS path basis

Juniper Networks, Inc. Copyright

27

Concepts
Multi-Exit Discriminator (MED)
Router A:
bgp {
group EXTERNAL {
type external;
neighbor 1.1.1.1 {
export MED;
peer-as 666;
}
}
}

Updated

policy-statement MED {
from as-path via-200;
then {
metric 200;
accept;
}
}
as-path via-200 ".* 200";

Juniper Networks, Inc. Copyright

28

Concepts
Multi-Exit Discriminator (MED)
AS 666

set MED = 200

AS 200

AS 1800
AS 1988
AS 2000
AS 173

Updated

Juniper Networks, Inc. Copyright

29

Concepts
Origin

describes how a route was injected into BGP at the originating AS


IGP

Default export type on policy statement for BGP


EGP

From protocol EGP, can be specified in the export policy


Incomplete

Unknown source of information, can be specified in the export


policy

Updated

Juniper Networks, Inc. Copyright

30

Concepts
Atomic Aggregate
Used

to inform BGP speaker about less specific


route.

More

specific route exists and is included in it

BGP speaker

receiving this attribute shall not


remove the attribute when propagating it

Updated

Juniper Networks, Inc. Copyright

31

Concepts
Aggregator (6-bytes)
Last AS

number that formed the aggregate


route (2 bytes)

IP address

of the BGP speaker that formed


the aggregate route (4-bytes)

Updated

Juniper Networks, Inc. Copyright

32

Concepts
Route Reflector and Confederation
Scaling

would be an issue when there are too many BGP


peer within the AS
BGP speaker would not pass the BGP routes learn from
an IBGP peer to another IBGP peers
Number of connection required = n(n-1)/2

Updated

Juniper Networks, Inc. Copyright

33

Concepts
Route Reflector RFC 1966
Acting

as a mirror to reflect the BGP routes learned


from the IBGP peers to the clients
Update from non-client to all clients
Update from client to all non-clients and the other clients
except the one originated the route
Provide the normal BGP speaker function to all other
non-clients
Pending cluster-list and originator ID

Updated

Juniper Networks, Inc. Copyright

34

Concepts
Route Reflector
IBGP

AS300

EBGP

EBGP
IBGP

IBGP
AS100

IBGP

IBGP
IBGP

AS200

IBGP

IBGP
EBGP

AS300

RR

EBGP

non-client
AS100

IBGP

client

Updated

AS200

IBGP

Juniper Networks, Inc. Copyright

client

35

Concepts
Route Reflector
Loop

Prevention

Originator

ID
If the attribute originator ID has not been created in the
attribute of the route, the RR will create this attribute
The content of originator ID is the router ID of the IBGP peer
that pass this route to the RR

The RR would not reflect the route back to the


originator

Updated

Juniper Networks, Inc. Copyright

36

Concepts
Route Reflector
Loop

Prevention

Cluster

list
When the RR reflect the route to other peers, it will prepend its
cluster ID within the cluster list

If the RR receive a route with its cluster ID within the


cluster list, the route would be discarded

Updated

Juniper Networks, Inc. Copyright

37

Concepts
Confederation RFC 1965
Scale

down an AS into several Sub-ASs


Each BGP peers between sub-AS would act as EBGP peer
except some of the attributes remain unchanged
Local-preference passed through such a connect
MED, next-hop unchanged between member ASs of the
confederation.

Updated

Juniper Networks, Inc. Copyright

38

Concepts
Confederation
IBGP

IBGP
EBGP
IBGP

IBGP

IBGP
AS100

IBGP
IBGP
IBGP

EBGP

IBGP

EBGP

AS200

AS65500

IBGP

IBGP
AS100

IBGP
IBGP
IBGP
AS65501
AS200

Updated

Juniper Networks, Inc. Copyright

39

Summary
BGP Concept
BGP Operation
Route

Control

Configuration
Trouble-shooting
Juniper

Updated

vs. Cisco

Juniper Networks, Inc. Copyright

40

BGP Protocol Messages

Four types of messages


Open
Update
Keepalive
Notification

Updated

Juniper Networks, Inc. Copyright

41

BGP Header
0
1
2
3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
+
+
|
|
+
+
|
Marker
|
+
+
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Length
|
Type
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Marker: synchronization and authentication

Updated

Juniper Networks, Inc. Copyright

42

BGP Open message


0
1
2
3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+
|
Version
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
My Autonomous System
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
Hold Time
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
BGP Identifier
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Opt Parm Len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
Optional Parameters
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Updated

Juniper Networks, Inc. Copyright

43

OPEN Message (Cont.)

Optional Parameters
Authentication

Information (type 1)

0 1 2 3 4 5 6 7 8
+-+-+-+-+-+-+-+-+
| Auth. Code
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
Authentication Data
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Updated

Juniper Networks, Inc. Copyright

44

NOTIFICATION Message
0
1
2
3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error code
| Error subcode |
Data
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

1 = HRD Error
2 = OPEN Error
3= UPDATE Error
4 = Hold Time Expired
5 = FSM Error
6 = Cease(for fatal errors

listed)

Updated

besides the ones already

Juniper Networks, Inc. Copyright

45

UPDATE Message
+-----------------------------------------------------+
|
Unfeasible Routes Length (2 octets)
|
+-----------------------------------------------------+
| Withdrawn Routes (variable)
|
+-----------------------------------------------------+
|
Total Path Attribute Length (2 octets)
|
+-----------------------------------------------------+
|
Path Attributes (variable)
|
+-----------------------------------------------------+
|
Network Layer Reachability Information (variable) |
+-----------------------------------------------------+
0
1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Attr. Flags |Attr. Type Code|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Updated

+---------------------------+
|
Length (1 octet)
|
+---------------------------+
|
Prefix (variable)
|
+---------------------------+

Juniper Networks, Inc. Copyright

46

BGP Operation
BGP-4 Message Exchange
BGPPeers

TCP

BGP

Idle
Connect

Initializing
OpenSent
OpenConfirm
Established

Updated

SynSent
Established
Open

KeepAlive

Update

TCP

syn
Syn +Ack
Ack

BGP

Listen
SynReceived
Established
Open

KeepAlive

Update

Juniper Networks, Inc. Copyright

Idle
Connect

Initializing
OpenSent
OpenConfirm
Established

47

BGP Operation
BGP-4 FSM
Idle

1
2

3
4

Connect

6
12

5
11

OpenSent

9
10

Active

13

OpenConfirm

14

15

Established

Updated

16

Juniper Networks, Inc. Copyright

48

BGP Operation
Current
State

New
State

Event

Idle

Idle
Connect

1). Error
2). Start

Connect

Idle
Connect
Open Sent

3).
4).
5).
6).

Active

Any other event


ConnectRetry Timer Expired
Transport Protocol Connect Succeeds
Transport Protocol Connect Fails

Open sent--- Wait for open from peer


Open Sent

Updated

Idle

7). Stop, Open Error, Connection Collision,


Hold Timer Expires, or any other event

Open Confirm
Active

8). No Errors
9). Disconnect Notification

Juniper Networks, Inc. Copyright

49

BGP Operation
Current
State

New
State

Event

Active

Open Sent
Connect
Active

10). Transport Connect Protocol Succeeds


11). ConnectRetry Timer Expired
12). Remote Peer Trying, IP Address Not
Expected

Idle

13). Any Other Event

Open Confirm (waiting notification or keepalive handshake)


Open Confirm

Established

Updated

Idle

14). Hold Timer Expired, Notification,


Disconnect, Stop, or any other event

Established

15). Keepalive

Idle

16). Notification, UPDATE Message error


Disconnect Notification, Hold Timer
Expired, Stop, or any other event

Juniper Networks, Inc. Copyright

50

Summary
BGP Concept
BGP Operation
Route

Control

Configuration
Trouble-shooting
Juniper

Updated

vs. Cisco

Juniper Networks, Inc. Copyright

51

Route Control

Route Selection

Route with lowest preference value


Route with highest local preference
Route with the shortest AS path length
Route with the lowest origin code ( IGP < EGP < incomplete )
Route with the lowest MED (cisco-nondeterministic / always-compare-med )
Routes are local generated
Routes from EBGP peer
Routes with the closest next-hop (determined by IGP metric)
Routes from the peer with lowest router-id
Routes from the neighbor with lowest IP address

Updated

Juniper Networks, Inc. Copyright

52

Route Control

Policy Control
Import

/ Export Policy
Communities
AS path
Route filtering

Updated

Juniper Networks, Inc. Copyright

53

Route Control

Import / Export Policy


Per

group / neighbor import / export policy

Used

for advertise routes originated from the


local AS

Used

for change / add / delete BGP attributes

Global

specific > Group specific > Neighbor


specific

Updated

Juniper Networks, Inc. Copyright

54

Route Control

Import / Export Policy


Applying

policies:

bgp {
import global-import-policy-here;
export global-export-policy-here;
group testing-policy {
import group-import-policy-here;
export group-export-policy-here;
neighbor 1.1.1.1 {
import neighbor-import-policy-here;
export neighbor-export-policy-here;
}
}
}

Updated

Juniper Networks, Inc. Copyright

55

Route Control

Import / Export Policy


Check

the routes received from a peer before


applying an import policy:
show route receive-protocol bgp 1.1.1.1

Check

the routes sent to a peer after


applying an export policy:
show route advertising-protocol bgp 1.1.1.1

Updated

Juniper Networks, Inc. Copyright

56

Route Control

Community
Well-known

community

no-advertise
Do not advertise to neighbors
no-export
Do not advertise outside your confederation/AS
no-export-subconfed Do not advertise outside your subconfederation

Define

Community

community community-name members [ 100:10 100:30 ];

Updated

Juniper Networks, Inc. Copyright

57

Route Control

AS Path
AS

Path Regular Expressions

{m,n}
{m}
{m,}
*
+
?
|

Updated

at least m and most n repetitions of term.


Exact m repetitions of term
m or more repetitions of term
Zero or more repetitions of term
One or more repetitions of term
Zero or one repetitions of term
One of the two terms on either side of the pipe

Juniper Networks, Inc. Copyright

58

Route Control

Route filtering
Filtering

based on IP prefix / AS path /


Community string / Neighbor / Origin ..
Import / Export policy

Updated

Juniper Networks, Inc. Copyright

59

Route Control

Route filtering
Matching

criteria

+ as-path
+ community
local-preference
+ neighbor
Origin
> prefix-list
> route-filter

Updated

Name of AS path regular expression (BGP only)


BGP community
Local preference associated with a route
Neighboring router
BGP origin attribute
List of prefix-lists of routes to match
List of routes to match

Juniper Networks, Inc. Copyright

60

Route Control

Route filtering
Matching AS

Path

policy-statement filtering {
from as-path testing-as-path;
then accept;
}
as-path testing-as-path ".* 200";

Updated

Juniper Networks, Inc. Copyright

61

Route Control

Route filtering
Matching

Community string

policy-statement filtering {
from community testing-community;
then accept;
}
community testing-community members 100:200;

Updated

Juniper Networks, Inc. Copyright

62

Route Control

Route filtering
Matching

route entry

policy-statement filtering {
from route-filter 100.100.0.0/16 orlonger;
then accept;
}

Updated

Juniper Networks, Inc. Copyright

63

Route Control

Route filtering
Matching

within a group of route entries

prefix-list route-list {
100.100.0.0/16;
100.110.0.0/16;
100.120.0.0/16;
}
policy-statement filtering {
from prefix-list route-list;
then accept;
}

Updated

Juniper Networks, Inc. Copyright

64

Summary
BGP Concept
BGP Operation
Route

Control

Configuration
Trouble-shooting
Juniper

Updated

vs. Cisco

Juniper Networks, Inc. Copyright

65

Configuration
BGP minimum

configuration

[routing-options]
autonomous-system <your own AS>;
[protocol bgp]
group BGP-setup {
type [external | internal];
peer-as <peers AS>;
neighbor <peer IP address>;
}

Updated

Juniper Networks, Inc. Copyright

66

Configuration
Example
[protocol bgp]
group BGP-setup {
type external;
peer-as 100;
neighbor 100.1.1.2;
}
[routing-options]
autonomous-system 200;

Updated

Juniper Networks, Inc. Copyright

67

Configuration
Set

the local-preference
[protocol bgp]
group BGP-setup {
type external;
local-preference 100;
peer-as 100;
neighbor 100.1.1.2;
}

Set

the MED
[protocol bgp]
group BGP-setup {
type external;
metric-out 200;
local-preference 100;
peer-as 100;
neighbor 100.1.1.2;
}

Updated

Juniper Networks, Inc. Copyright

68

Configuration
Change

the origin

[protocol policy-options]
policy-statement change-origin {
from protocol aggregate;
then {
origin incomplete;
accept;
}
}
[protocol bgp]
group BGP-setup {
type external;
export change-origin;
peer-as 100;
neighbor 100.1.1.2;
}

Updated

Juniper Networks, Inc. Copyright

69

Configuration
AS-prepend
[policy-options]
policy-statement as-prepend {
from protocol aggregate;
then {
as-path-prepend 300 300 300";
accept;
}
}
[protocol bgp]
group BGP-setup {
type external;
export as-prepend;
peer-as 100;
neighbor 100.1.1.2;
}

Updated

Juniper Networks, Inc. Copyright

70

Configuration
Attach

community

[protocol bgp]
group BGP-setup {
type external;
export att-community;
peer-as 100;
neighbor 100.1.1.2;
}
[policy-options]
policy-statement att-community {
then {
community set send-community;
}
}
community send-community members [ 100:10 200:10 ];

Updated

Juniper Networks, Inc. Copyright

71

Configuration
Route

Reflector

[protocol bgp]
group RR-client {
type internal;
cluster 100.1.1.1;
neighbor 100.1.1.2;
neighbor 100.1.1.3;
}
group non-client {
type internal;
neighbor 10.1.1.2;
}
group EBGP {
type external;
peer-as 100;
neighbor 192.168.1.2;
}

Updated

Juniper Networks, Inc. Copyright

72

Configuration
Confederation
[routing-options]
autonomous-system 65000;
confederation 200 members [ 65000 65001 ];
[protocol bgp]
group confe {
type external;
peer-as 65001;
neighbor 100.1.1.2;
}

Updated

Juniper Networks, Inc. Copyright

73

Configuration
Advertise

summary network

[routing-options]
aggregate {
route 202.168.0.0/17 discard;
}
[policy-options]
policy-statement adv-summary {
from protocol aggregate;
then accept;
}
[protocol bgp]
group BGP-setup {
type external;
export adv-summary;
peer-as 100;
neighbor 100.1.1.2;
}

Updated

Juniper Networks, Inc. Copyright

74

Configuration
Advertise

the routing entries in other protocol

[policy-options]
policy-statement adv-ospf {
from protocol ospf;
then accept;
}
[protocol bgp]
group BGP-setup {
type external;
export adv-ospf;
peer-as 100;
neighbor 100.1.1.2;
}

Updated

Juniper Networks, Inc. Copyright

75

Summary
BGP concepts
BGP Operation
Route

Control

Configuration
Trouble-shooting
Juniper

Updated

vs. Cisco

Juniper Networks, Inc. Copyright

76

Trouble-shooting
Checking

the BGP neighbor status

root@router> show bgp summary


Groups: 1
Peers: 1 Down Peers: 0
Table
Tot Paths Act Paths Suppressed History Damp State Pending
inet.0
0
0
0
0
0
0
inet.2
0
0
0
0
0
0
Peer
AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Damped...
100.1.1.2
65001
275
279
0
0 02:17:30 0/0/0
0/0/0

Updated

Juniper Networks, Inc. Copyright

77

Trouble-shooting

Neighbor cant establish


Groups: 1
Peers: 1 Down Peers: 1
Table
Tot Paths Act Paths Suppressed History Damp State Pending
inet.0
0
0
0
0
0
0
inet.2
0
0
0
0
0
0
Peer
AS
InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Damped...
100.1.1.2
65001
0
4
0
0 00:00:57 Active

Enable traceoption
[protocol bgp]
traceoptions {
file bgp-trace;
flag packets detail;
flag open detail;
}

Updated

Juniper Networks, Inc. Copyright

78

Trouble-shooting

Monitoring
root@router> monitor start bgp-trace
*** bgp-trace ***
Nov 10 14:53:50
Nov 10 14:53:50 BGP RECV 100.1.1.2+1113 -> 100.1.1.1+179
Nov 10 14:53:50 BGP RECV message type 1 (Open) length 45
Nov 10 14:53:50 BGP RECV version 4 as 65001 holdtime 90 id 192.168.1.2 parmlen 16
Nov 10 14:53:50 MP capability AFI=1, SAFI=1
Nov 10 14:53:50 Refresh capability, code=128
Nov 10 14:53:50 Refresh capability, code=2
Nov 10 14:53:50 bgp_pp_recv: dropping 100.1.1.2 (External AS 65001), connection collision prefers
100.1.1.2+1113 (proto)
Nov 10 14:53:50 bgp_send: sending 45 bytes to 100.1.1.2 (External AS 65001)
Nov 10 14:53:50
Nov 10 14:53:50 BGP SEND 100.1.1.1+179 -> 100.1.1.2+1113
Nov 10 14:53:50 BGP SEND message type 1 (Open) length 45

Updated

Juniper Networks, Inc. Copyright

79

Trouble-shooting
Monitoring
Nov 10 14:53:50 BGP SEND version 4 as 65000 holdtime 90 id 192.168.1.1 parmlen 16
Nov 10 14:53:50 MP capability AFI=1, SAFI=1
Nov 10 14:53:50 Refresh capability, code=128
Nov 10 14:53:50 Refresh capability, code=2
Nov 10 14:53:50 bgp_send: sending 19 bytes to 100.1.1.2 (External AS 65001)
Nov 10 14:53:50
Nov 10 14:53:50 BGP SEND 100.1.1.1+179 -> 100.1.1.2+1113
Nov 10 14:53:50 BGP SEND message type 4 (KeepAlive) length 19
Nov 10 14:53:50
Nov 10 14:53:50 BGP RECV 100.1.1.2+1113 -> 100.1.1.1+179
Nov 10 14:53:50 BGP RECV message type 3 (Notification) length 21
Nov 10 14:53:50 BGP RECV Notification code 2 (Open Message Error) subcode 2 (bad peer AS
number)

root@router> monitor stop bgp-trace

Updated

Juniper Networks, Inc. Copyright

80

Trouble-shooting
Configuration
Near end
[routing-options]
autonomous-system 65000;
confederation 200 members [ 65000 65001 65002 ];
[protocol bgp]
Far End
group bgp-demo {
[routing-options]
type external;
autonomous-system 65001;
peer-as 65001;
confederation 200 members [ 65000 65001 65002 ];
neighbor 100.1.1.2;
[protocol bgp]
}
admin@Jessie# show protocols bgp
group testing {
type external;
peer-as 65002;
neighbor 100.1.1.1;
}

Updated

Juniper Networks, Inc. Copyright

81

Trouble-shooting
Logged

result:

root@router> file show /var/log/?


Possible completions:
<[Enter]>
Execute this command
<filename>
Filename to display
/var/log/bgp-trace Size: 2459, Last changed: Nov 7 18:41:08

Stop

logging:

root@router# delete protocols bgp traceoptions


root@router# commit

Updated

Juniper Networks, Inc. Copyright

82

Trouble-shooting
Other

problem

Local-address definition (ciscos update-source)


[protocol bgp]
group <group> {
local-address <local IP address>;
}

Peer AS mis-configured

Peer address unreachable

Mulithop issue for EBGP


[protocol bgp]
group <group> {
multihop;
}

Updated

Juniper Networks, Inc. Copyright

83

Trouble-shooting
Problem

Report

show

bgp summary
show bgp neighbor
show bgp group
show version
show configuration

Updated

Juniper Networks, Inc. Copyright

84

Summary
BGP concepts
BGP Operation
Route

Control

Configuration
Trouble-shooting
Juniper

Updated

vs. Cisco

Juniper Networks, Inc. Copyright

85

Presentation and command difference between


Juniper and Cisco
Juniper:
fxp1 {
unit 0 {
family inet { address 172.27.4.172/24; }
}
}
lo0 {
unit 0 {
family inet { address 192.168.1.3/32; }
}
}
routing-options {
autonomous-system 100;
}
group Cisco {
type external;
multihop;
local-address 192.168.1.3;
peer-as 200;
neighbor 192.168.1.254;
}

Updated

Cisco:
interface Loopback0
ip address 192.168.1.254 255.255.255.255
!
interface Ethernet0
ip address 172.27.4.173 255.255.255.0
!
router bgp 200
neighbor 192.168.1.3 remote-as 100
neighbor 192.168.1.3 ebgp-multihop 255
neighbor 192.168.1.3 update-source Loopback0
!

Juniper

Juniper Networks, Inc. Copyright

Cisco

86

Presentation and command difference between


Juniper and Cisco
root@Juniper> show bgp summary
Groups: 1
Peers: 1 Down Peers: 0
Table
Tot Paths Act Paths Suppressed History Damp State Pending
inet.0
0
0
0
0
0
0
inet.2
0
0
0
0
0
0
Peer
AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|
#Active/Received/Damped...
192.168.1.254 200
12
14
0
0 00:05:46 0/0/0
0/0/0

Cisco#show ip bgp summary


BGP table version is 1, main routing table version 1
Neighbor
192.168.1.3

Updated

V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd


4 100 14 14
1 0 0 00:05:39
0

Juniper Networks, Inc. Copyright

87

Presentation and command difference between


Juniper and Cisco
root@Juniper> show bgp neighbor
Peer: 192.168.1.254+179 AS 200 Local: 192.168.1.3+3844 AS 100
Type: External State: Established Flags: <>
Last State: OpenConfirm
Last Event: RecvKeepAlive
Last Error: None
Options: <Multihop Preference LocalAddress HoldTime PeerAS Refresh>
Local Address: 192.168.1.3 Holdtime: 90 Preference: 170
Number of flaps: 0
Peer ID: 192.168.1.254
Local ID: 192.168.1.3 Active Holdtime: 90
Keepalive Interval: 30
NLRI advertised by peer:
NLRI for this session: inet-unicast
Peer does not support Refresh capability

Updated

Juniper Networks, Inc. Copyright

88

Presentation and command difference between


Juniper and Cisco
Table inet.0 Bit: 10000
Active Prefixes: 0
Received Prefixes: 0
Suppressed due to damping: 0
Table inet.2 Bit: 20000
Active Prefixes: 0
Received Prefixes: 0
Suppressed due to damping: 0
Last traffic (seconds):
Received 3 Sent 3 Checked 3
Input messages: Total 16 Updates 0
Refreshes 0 Octets 304
Output messages: Total 18 Updates 0
Refreshes 0 Octets 368
Output Queue[0]: 0
Output Queue[1]: 0
Route Queue Timer: unset Route Queue: empty

Updated

Juniper Networks, Inc. Copyright

89

Presentation and command difference between


Juniper and Cisco
Cisco#show ip bgp neighbors
BGP neighbor is 192.168.1.3, remote AS 100, external link
Index 1, Offset 0, Mask 0x2
BGP version 4, remote router ID 192.168.1.3
BGP state = Established, table version = 1, up for 00:08:45
Last read 00:00:15, hold time is 90, keepalive interval is 30 seconds
Minimum time between advertisement runs is 30 seconds
Received 20 messages, 0 notifications, 0 in queue
Sent 20 messages, 0 notifications, 0 in queue
Connections established 1; dropped 0
Last reset never
No. of prefix received 0
External BGP neighbor may be up to 255 hops away.
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 192.168.1.254, Local port: 179
Foreign host: 192.168.1.3, Foreign port: 3844
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)

Updated

Juniper Networks, Inc. Copyright

90

Presentation and command difference between


Juniper and Cisco
Event Timers (current time is 0x2590F0):
Timer
Starts Wakeups
Next
Retrans
21
0
0x0
TimeWait
0
0
0x0
AckHold
20
17
0x0
SendWnd
0
0
0x0
KeepAlive
0
0
0x0
GiveUp
0
0
0x0
PmtuAger
0
0
0x0
DeadWait
0
0
0x0
iss: 401687383 snduna: 401687774 sndnxt: 401687774 sndwnd: 16384
irs: 486200570 rcvnxt: 486200977 rcvwnd:
15978 delrcvwnd: 406
SRTT: 342 ms, RTTO: 1337 ms, RTV: 326 ms, KRTT: 0 ms
minRTT: 4 ms, maxRTT: 300 ms, ACK hold: 200 ms
Flags: passive open, nagle, gen tcbs
Datagrams (max data segment is 556 bytes):
Rcvd: 25 (out of order: 0), with data: 20, total data bytes: 406
Sent: 38 (retransmit: 0), with data: 20, total data bytes: 390

Updated

Juniper Networks, Inc. Copyright

91

Presentation and command difference between


Juniper and Cisco
Juniper

Cisco

no synchronization ( Default behavior )


set policy-options damping cisco
set routing-options confederation members
set protocols bgp group Cisco cluster

no synchronization
bgp damping
bgp confederation
bgp cluster-id

show bgp neighbor


show bgp summary
show route aspath-regex "200"

show ip bgp neighbor


show ip bgp summary
show ip bgp regexp ^200$

Updated

Juniper Networks, Inc. Copyright

92

Thank you!
http://www.juniper.net

S-ar putea să vă placă și