...
Configuring a BGP Router ID
The router ID should be configured first when you configure BGP. The router ID is a string similar to the IP address, and is the identifier of a BGP router in an AS. You should not change the router ID after completing the configuration. By default, the BGP router ID is not configured.
Code Block |
---|
admin@XorPlus# set protocols bgp bgp-id 1.1.1.1 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP Local-AS
The local AS (autonomous system) should be configured first when you configure BGP.
The AS_Path attribute records to all the AS's that a route passes through, from the source to the destination, following the order of vectors.
Code Block |
---|
admin@XorPlus# set protocols bgp local-as 100 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring External BGP Peering
If the AS number of the specified peer is different from the local AS number during the configuration of BGP peers, an EBGP peer is configured. To establish point-to-point connections between peer autonomous systems, configure a BGP session on each interface of a point-to-point link. Generally, such sessions are made at network exit points with neighboring hosts outside the AS.
Code Block |
---|
admin@XorPlus# set protocols bgp local-as 100 admin@XorPlus# set protocols bgp peer 192.168.49.1 as 200 admin@XorPlus# set protocols bgp peer 192.168.49.1 next-hop-self true admin@XorPlus# set protocols bgp peer 192.168.49.1 local-ip 192.168.49.2 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring Internal BGP Peering
If the AS number of the specified peer is the same as the local AS number during the configuration of BGP peers, an IBGP peer is configured.
Code Block |
---|
admin@XorPlus# set protocols bgp local-as 100 admin@XorPlus# set protocols bgp peer 192.168.49.1 as 100 admin@XorPlus# set protocols bgp peer 192.168.49.1 next-hop-self true admin@XorPlus# set protocols bgp peer 192.168.49.1 local-ip 192.168.49.2 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring the BGP Local Preference
Internal BGP (IBGP) sessions use a metric called the local preference, which is carried in IBGP update packets in the path attribute LOCAL_PREF. When an autonomous system (AS) has multiple routes to another AS, the local preference indicates the degree of preference for one route over the other routes. The route with the highest local preference value is preferred.
Code Block |
---|
admin@XorPlus# set policy policy-statement send-network term t1 from network4 172.168.200.0/24 admin@XorPlus# set policy policy-statement send-network term t1 from protocol bgp admin@XorPlus# set policy policy-statement send-network term t1 then localpref 200 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# set protocols bgp peer 192.168.49.1 export send-network admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP MED
The multi-exit discriminator (MED) helps determine the optimal route for the incoming traffic of an AS, and is similar to the metric used in IGP. When a BGP device obtains multiple routes to the same destination address but with different next hops from EBGP peers, the BGP device selects the route with the smallest MED value as the optimal route.
Code Block |
---|
admin@XorPlus# set policy policy-statement send-network term t1 from network4 172.168.200.0/24 admin@XorPlus# set policy policy-statement send-network term t1 from protocol bgp admin@XorPlus# set policy policy-statement send-network term t1 then med 200 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# set protocols bgp peer 192.168.49.1 export send-network admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP Next Hop
When an Autonomous System Boundary Router (ASBR) forwards the route learned from an EBGP peer to an IBGP peer, the ASBR, by default, does not change the next hop of the route. When the IBGP peer receives this route, it finds the next hop unreachable, sets the route to inactive, and does not use this route to guide traffic forwarding.
...
Code Block |
---|
admin@XorPlus# set protocols bgp local-as 100 admin@XorPlus# set protocols bgp peer 192.168.49.1 as 100 admin@XorPlus# set protocols bgp peer 192.168.49.1 next-hop-self true admin@XorPlus# set protocols bgp peer 192.168.49.1 local-ip 192.168.49.2 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP Route Reflectors
To ensure the connectivity between IBGP peers within an AS, you need to establish full-mesh connections between the IBGP peers. When there are many IBGP peers, it is costly to establish a fully meshed network. A route reflector (RR) can solve this problem.
...
Code Block |
---|
admin@XorPlus# set protocols bgp local-as 100 admin@XorPlus# set protocols bgp peer 192.168.49.1 as 100 admin@XorPlus# set protocols bgp peer 192.168.49.1 next-hop-self true admin@XorPlus# set protocols bgp peer 192.168.49.1 local-ip 192.168.49.2 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# admin@XorPlus# set protocols bgp route-reflector cluster-id 16.16.16.16 admin@XorPlus# set protocols bgp route-reflector disable false admin@XorPlus# set protocols bgp peer 192.168.49.1 client true admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP Confederations
A confederation divides an AS into sub-AS's, which establish EBGP connections. Within each sub-AS, IBGP peers establish full-mesh connections or have an RR configured. On a large BGP network, configuring a confederation can reduce the number of IBGP connections, simplify routing policy management, and improve route advertisement efficiency.
Code Block |
---|
admin@XorPlus# set protocols bgp local-as 65533 admin@XorPlus# set protocols bgp peer 192.168.49.1 as 65533 admin@XorPlus# set protocols bgp peer 192.168.49.1 next-hop-self true admin@XorPlus# set protocols bgp peer 192.168.49.1 local-ip 192.168.49.2 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# admin@XorPlus# set protocols bgp confederation identifier 2000 admin@XorPlus# set protocols bgp confederation disable false admin@XorPlus# set protocols bgp peer 192.168.49.1 confederation-member true admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring the BGP Connect Timer
Hold timers can be configured for all peers. The proper maximum interval at which 'keep alive' messages are sent is one third the hold time.
Code Block |
---|
admin@XorPlus# set protocols bgp peer 192.168.49.1 holdtime 30 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring MD5 Authentication for TCP Connections
Configure Message Digest5 (MD5) authentication on a TCP connection between two BGP peers. The two peers must have the same configured password to establish TCP connections.
Code Block |
---|
admin@XorPlus# set protocols bgp peer 192.168.11.10 md5-password pica8 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring EBGP Fast-External-Fallover
This feature allows BGP to immediately respond to a fault on an interface, and delete the direct EBGP sessions on the interface without waiting for the hold timer to expire. It implements rapid BGP network convergence. By default, EBGP fast-external-fallover is disabled.
Code Block |
---|
admin@XorPlus# set protocols bgp fast-external-fallover disable false admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP Route Summarization
BGP supports both automatic and manual route summarization. Manual route summarization takes precedence over automatic.
...
Code Block |
---|
admin@XorPlus# set protocols bgp aggregate network4 192.168.1.0/24 suppress-detail true admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP to Advertise Default Routes to Peers
The BGP device can be configured to send only a default route, with the local address as the next hop address, to its peer, regardless of whether there are default routes in the local routing table.
...
Code Block |
---|
admin@XorPlus# set protocols bgp peer 192.168.11.10 public-as-only admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP AS Loop
Repeated local AS numbers are allowed in routes. In the default setting, however, repeated local AS numbers are not allowed.
Code Block |
---|
admin@XorPlus# set protocols bgp peer 192.168.11.10 allow-as-loop true admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
Configuring BGP Load Balancing
If multiple paths to a destination exist, you can configure load balancing over such paths to improve link utilization.
...