• No results found

Understanding BGP on page 120

Example: Configuring External BGP Point-to-Point Peer Sessions on page 126

Example: Configuring Internal BGP Peer Sessions on page 133

Example: Configuring External BGP Point-to-Point Peer Sessions

This example shows how to configure BGP point-to-point peer sessions.

Requirements on page 126

Overview on page 126

Configuration on page 127

Verification on page 129

Requirements

Before you begin, if the default BGP policy is not adequate for your network, configure routing policies to filter incoming BGP routes and to advertise BGP routes.

Overview

Figure 26 on page 126shows a network with BGP peer sessions. In the sample network, Device E in AS 17 has BGP peer sessions to a group of peers called external-peers. Peers A, B, and C reside in AS 22 and have IP addresses 10.10.10.2, 10.10.10.6, and 10.10.10.10.

Peer D resides in AS 79, at IP address 10.21.7.2. This example shows the configuration on Device E.

Figure 26: Typical Network with BGP Peer Sessions

AS 22

AS 79 AS 17

C B

A

D E

10.1 10.5 10.9 7.1

10.2

10.6

10.10

7.2

g040727

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

set interfaces ge-1/2/0 unit 0 description to-A

set interfaces ge-1/2/0 unit 0 family inet address 10.10.10.1/30 set interfaces ge-0/0/1 unit 5 description to-B

set interfaces ge-0/0/1 unit 5 family inet address 10.10.10.5/30 set interfaces ge-0/1/0 unit 9 description to-C

set interfaces ge-0/1/0 unit 9 family inet address 10.10.10.9/30 set interfaces ge-1/2/1 unit 21 description to-D

set interfaces ge-1/2/1 unit 21 family inet address 10.21.7.1/30 set protocols bgp group external-peers type external set protocols bgp group external-peers peer-as 22 set protocols bgp group external-peers neighbor 10.10.10.2 set protocols bgp group external-peers neighbor 10.10.10.6 set protocols bgp group external-peers neighbor 10.10.10.10

set protocols bgp group external-peers neighbor 10.21.7.2 peer-as 79 set routing-options autonomous-system 17

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in theJunos OS CLI User Guide.

To configure the BGP peer sessions:

1. Configure the interfaces to Peers A, B, C, and D.

[edit interfaces]

user@E# set ge-1/2/0 unit 0 description to-A

user@E# set ge-1/2/0 unit 0 family inet address 10.10.10.1/30 user@E# set ge-0/0/1 unit 5 description to-B

user@E# set ge-0/0/1 unit 5 family inet address 10.10.10.5/30 user@E# set ge-0/1/0 unit 9 description to-C

user@E# set ge-0/1/0 unit 9 family inet address 10.10.10.9/30 user@E# set ge-1/2/1 unit 21 description to-D

user@E# set ge-1/2/1 unit 21 family inet address 10.21.7.1/30 2. Set the autonomous system (AS) number.

[edit routing-options]

user@E# set autonomous-system 17

3. Create the BGP group, and add the external neighbor addresses.

[edit protocols bgp group external-peers]

user@E# set neighbor 10.10.10.2 user@E# set neighbor 10.10.10.6 user@E# set neighbor 10.10.10.10

4. Specify the autonomous system (AS) number of the external AS.

[edit protocols bgp group external-peers]

user@E# set peer-as 22

5. Add Peer D, and set the AS number at the individual neighbor level.

[edit protocols bgp group external-peers]

user@E# set neighbor 10.21.7.2 peer-as 79 6. Set the peer type to external BGP (EBGP).

[edit protocols bgp group external-peers]

user@E# set type external

Results From configuration mode, confirm your configuration by entering the show interfaces, show protocols, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

[edit]

neighbor 10.10.10.6;

If you are done configuring the device, enter commit from configuration mode.

Verification

Confirm that the configuration is working properly.

Verifying BGP Neighbors on page 129

Verifying BGP Groups on page 132

Verifying BGP Summary Information on page 132

Verifying Reachability of All Peers in a BGP Network on page 132

Verifying BGP Neighbors

Purpose Verify that BGP is running on configured interfaces and that the BGP session is active for each neighbor address.

Action From operational mode, run the show bgp neighbor command.

user@E> show bgp neighbor

Peer: 10.10.10.2+179 AS 22 Local: 10.10.10.1+65406 AS 17 Type: External State: Established Flags: <Sync>

Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None

Options: <Preference PeerAS Refresh>

Holdtime: 90 Preference: 170 Number of flaps: 0

Peer ID: 10.10.10.2 Local ID: 10.10.10.1 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 0

BFD: disabled, down

Local Interface: ge-1/2/0.0 NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast

NLRI for this session: inet-unicast Peer supports Refresh capability (2) Restart time configured on the peer: 120 Stale routes from peer are kept for: 300 Restart time requested by this peer: 120

NLRI that peer supports restart for: inet-unicast NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 22) Peer does not support Addpath

Table inet.0 Bit: 10000

RIB State: BGP restart is complete

Send state: in sync

Peer: 10.10.10.6+54781 AS 22 Local: 10.10.10.5+179 AS 17 Type: External State: Established Flags: <Sync>

Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None

Options: <Preference PeerAS Refresh>

Holdtime: 90 Preference: 170 Number of flaps: 0

Peer ID: 10.10.10.6 Local ID: 10.10.10.1 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 1

BFD: disabled, down

Local Interface: ge-0/0/1.5 NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast

NLRI for this session: inet-unicast Peer supports Refresh capability (2) Restart time configured on the peer: 120 Stale routes from peer are kept for: 300 Restart time requested by this peer: 120

NLRI that peer supports restart for: inet-unicast NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 22) Peer does not support Addpath

Table inet.0 Bit: 10000

RIB State: BGP restart is complete

Peer: 10.10.10.10+55012 AS 22 Local: 10.10.10.9+179 AS 17 Type: External State: Established Flags: <Sync>

Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None

Options: <Preference PeerAS Refresh>

Holdtime: 90 Preference: 170 Number of flaps: 0

Peer ID: 10.10.10.10 Local ID: 10.10.10.1 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 2

BFD: disabled, down

Local Interface: fe-0/1/0.9 NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast

NLRI for this session: inet-unicast Peer supports Refresh capability (2) Restart time configured on the peer: 120 Stale routes from peer are kept for: 300 Restart time requested by this peer: 120

NLRI that peer supports restart for: inet-unicast NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 22) Peer does not support Addpath

Table inet.0 Bit: 10000

RIB State: BGP restart is complete Type: External State: Established Flags: <ImportEval Sync>

Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None

Options: <Preference PeerAS Refresh>

Holdtime: 90 Preference: 170 Number of flaps: 0

Peer ID: 10.21.7.2 Local ID: 10.10.10.1 Active Holdtime: 90 Keepalive Interval: 30 Peer index: 3

BFD: disabled, down

Local Interface: ge-1/2/1.21 NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast

NLRI for this session: inet-unicast Peer supports Refresh capability (2) Restart time configured on the peer: 120 Stale routes from peer are kept for: 300 Restart time requested by this peer: 120

NLRI that peer supports restart for: inet-unicast NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 79) Peer does not support Addpath

Table inet.0 Bit: 10000

RIB State: BGP restart is complete

Verifying BGP Groups

Purpose Verify that the BGP groups are configured correctly.

Action From operational mode, run the show bgp group command.

user@E> show bgp group

Group Type: External Local AS: 17 Name: external-peers Index: 0 Flags: <>

Holdtime: 0

Total peers: 4 Established: 4 10.10.10.2+179

10.10.10.6+54781 10.10.10.10+55012 10.21.7.2+61867 inet.0: 0/0/0/0

Groups: 1 Peers: 4 External: 4 Internal: 0 Down peers: 0 Flaps: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 0 0 0 0 0 0

Verifying BGP Summary Information Purpose Verify that the BGP configuration is correct.

Action From operational mode, run the show bgp summary command.

user@E> show bgp summary

Groups: 1 Peers: 4 Down peers: 0

Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...

10.10.10.2 22 8559 8470 0 0 2d 16:12:56 0/0/0/0 0/0/0/0

10.10.10.6 22 8566 8468 0 0 2d 16:12:12 0/0/0/0 0/0/0/0

10.10.10.10 22 8565 8466 0 0 2d 16:11:31 0/0/0/0 0/0/0/0

10.21.7.2 79 8560 8465 0 0 2d 16:10:58 0/0/0/0 0/0/0/0

Verifying Reachability of All Peers in a BGP Network

Purpose By using the ping tool on each peer address in the network, verify that all peers in the network are reachable from each device.

Action For each device in the BGP network:

1. In the J-Web interface, select Troubleshoot>Ping Host.

2. In the Remote Host box, type the name of a host for which you want to verify reachability from the device.

3. Click Start. Output appears on a separate page.

Sample Output

PING 10.10.10.10 : 56 data bytes

64 bytes from 10.10.10.10: icmp_seq=0 ttl=255 time=0.382 ms 64 bytes from 10.10.10.10: icmp_seq=1 ttl=255 time=0.266 ms

Meaning If a host is active, it generates an ICMP response. If this response is received, the round-trip time is listed in the time field.

Related Documentation

Junos OS Routing Policy Configuration Guide

Understanding External BGP Peering Sessions on page 125