Juniper: BGP Point-to-Point Peer

From OnnoWiki
Jump to navigation Jump to search

sumber: https://www.juniper.net/documentation/en_US/junos/topics/example/routing-protocol-bgp-security-point-to-point-peering-session-configuring-cli.html


This example shows how to configure BGP point-to-point peer sessions. 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 1 shows 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 1: Typical Network with BGP Peer Sessions Typical Network with BGP Peer Sessions 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. content_copy zoom_out_map 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 the CLI User Guide.

To configure the BGP peer sessions:

   Configure the interfaces to Peers A, B, C, and D.
   content_copy zoom_out_map
   [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
   Set the autonomous system (AS) number.
   content_copy zoom_out_map
   [edit routing-options]
   user@E# set autonomous-system 17
   Create the BGP group, and add the external neighbor addresses.
   content_copy zoom_out_map
   [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
   Specify the autonomous system (AS) number of the external AS.
   content_copy zoom_out_map
   [edit protocols bgp group external-peers]
   user@E# set peer-as 22
   Add Peer D, and set the AS number at the individual neighbor level.
   The neighbor configuration overrides the group configuration. So, while peer-as 22 is set for all the other neighbors in the group, peer-as 79 is set for neighbor 10.21.7.2.
   content_copy zoom_out_map
   [edit protocols bgp group external-peers]
   user@E# set neighbor 10.21.7.2 peer-as 79
   Set the peer type to external BGP (EBGP).
   content_copy zoom_out_map
   [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. content_copy zoom_out_map [edit] user@E# show interfaces ge-1/2/0 { unit 0 { description to-A; family inet { address 10.10.10.1/30; } } } ge-0/0/1 { unit 5 { description to-B; family inet { address 10.10.10.5/30; } } } ge-0/1/0 { unit 9 { description to-C; family inet { address 10.10.10.9/30; } } } ge-1/2/1 { unit 21 { description to-D; family inet { address 10.21.7.1/30; } } } content_copy zoom_out_map [edit] user@E# show protocols bgp { group external-peers { type external; peer-as 22; neighbor 10.10.10.2; neighbor 10.10.10.6; neighbor 10.10.10.10; neighbor 10.21.7.2 { peer-as 79; } } } content_copy zoom_out_map [edit] user@E# show routing-options autonomous-system 17;

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

Confirm that the configuration is working properly.

   Verifying BGP Neighbors
   Verifying BGP Groups
   Verifying BGP Summary Information

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 content_copy zoom_out_map

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
   Active prefixes:              0
   Received prefixes:            0
   Accepted prefixes:            0
   Suppressed due to damping:    0
   Advertised prefixes:          0
 Last traffic (seconds): Received 10   Sent 6    Checked 1   
 Input messages:  Total 8522   Updates 1       Refreshes 0     Octets 161922
 Output messages: Total 8433   Updates 0       Refreshes 0     Octets 160290
 Output Queue[0]: 0

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
   Send state: in sync
   Active prefixes:              0
   Received prefixes:            0
   Accepted prefixes:            0
   Suppressed due to damping:    0
   Advertised prefixes:          0
 Last traffic (seconds): Received 12   Sent 6    Checked 33  
 Input messages:  Total 8527   Updates 1       Refreshes 0     Octets 162057
 Output messages: Total 8430   Updates 0       Refreshes 0     Octets 160233
 Output Queue[0]: 0

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
   Send state: in sync
   Active prefixes:              0
   Received prefixes:            0
   Accepted prefixes:            0
   Suppressed due to damping:    0
   Advertised prefixes:          0
 Last traffic (seconds): Received 15   Sent 6    Checked 37  
 Input messages:  Total 8527   Updates 1       Refreshes 0     Octets 162057
 Output messages: Total 8429   Updates 0       Refreshes 0     Octets 160214
 Output Queue[0]: 0

Peer: 10.21.7.2+61867 AS 79 Local: 10.21.7.1+179 AS 17

 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
   Send state: in sync
   Active prefixes:              0     
   Received prefixes:            0
   Accepted prefixes:            0
   Suppressed due to damping:    0
   Advertised prefixes:          0
 Last traffic (seconds): Received 28   Sent 24   Checked 47  
 Input messages:  Total 8521   Updates 1       Refreshes 0     Octets 161943
 Output messages: Total 8427   Updates 0       Refreshes 0     Octets 160176
 Output Queue[0]: 0

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 content_copy zoom_out_map

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 content_copy zoom_out_map

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

Related Documentation




Referensi


Pranala Menarik