Basic BGP Configuration
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.
admin@XorPlus# set protocols bgp router-id 1.1.1.1 admin@XorPlus# commit Commit OK. Save done. admin@XorPlus#
Configuring BGP Local-AS
The local ASN (Autonomous System Number) should be configured when you configure BGP. An Autonomous System (AS) is a group of IP networks that are controlled by one entity, typically an Internet service provider (ISP), and that have the same routing policy. Each AS is assigned a unique AS number, which identifies an AS on a BGP network.
The AS_Path attribute records all the AS numbers that a route passes through, from the source to the destination, following the order of vectors.
admin@XorPlus# set protocols bgp local-as 100 admin@XorPlus# commit 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.
admin@XorPlus# set protocols bgp local-as 100 admin@XorPlus# set protocols bgp neighbor 192.168.49.1 remote-as 200 admin@XorPlus# commit 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.
admin@XorPlus# set protocols bgp local-as 100 admin@XorPlus# set protocols bgp neighbor 192.168.49.1 remote-as 100 admin@XorPlus# commit Commit OK. Save done. admin@XorPlus#
Configuring a BGP Peer Group
A large BGP network has a large number of peers. It is difficult to configure and maintain these peers. You can add the BGP peers with the same configurations to a BGP peer group and then configure the BGP peers in batches. This simplifies peer management and improves route advertisement efficiency.
NOTE:
- If a BGP configuration exists on a peer and its peer group, the BGP configuration on the peer takes precedence over the configuration on the peer group.
- If the peer you want to add to a group already exists in the BGP configuration, delete it first, than add it to the peer group.
The following example commands create a peer group called Leaf1 that includes two external peers.
admin@XorPlus# set protocols bgp peer-group Leaf1 admin@XorPlus# set protocols bgp neighbor leaf1 remote-as external admin@XorPlus# set protocols bgp neighbor 10.10.0.1 peer-group Leaf1 admin@XorPlus# set protocols bgp neighbor 10.10.0.12 peer-group Leaf1 admin@XorPlus# commit
Configuring BGP to Import Routes
BGP cannot discover routes and needs to import routes such as IGP routes into BGP routing tables so that the imported routes can be transmitted within an AS or between ASs. BGP imports routes in either redistribute or network mode.
NOTE:
If you do not want to control the route exchanging via use BGP policies, you need to disable feature ebgp-requires-policy manually, or the route cannot be correctly exchanged. For details about ebgp-requires-policy, see page /wiki/spaces/PicOS44sp/pages/4295428.
Redistribute Mode
In redistribute mode, BGP imports IGP routes, including RIP, OSPF, and IS-IS routes, into BGP routing tables based on protocol type. To ensure the validity of imported IGP routes, BGP can also import static routes and direct routes in redistribute mode.
Use the following command to configure to import BGP route:
set protocols bgp [vrf <vrf-name>] {ipv4-unicast|ipv6-unicast} redistribute {connected|kernel|ospf|static|table <table-number>} [metric <metric-number>|route-map <route-map>]
Network Mode
In network mode, BGP imports the routes in the IP routing table one by one to BGP routing tables. The network mode is more accurate than the redistribute mode. The ORIGIN attribute of BGP routes advertised in this way is IGP.
Use the following commands to configure BGP to statically add routes in the IP routing table to the BGP routing table and advertise these routes to peers.
Apply the specified route policy or a route label to control network advertisements with the following command:
set protocols bgp [vrf <vrf-name>] {ipv4-unicast|ipv6-unicast} network <ipv4/prefixlen> [label-index<label-index>|route-map <ROUTE-MAP-NAME>]
The network mode command is used to import exactly-matching routes. The mask length as configured in the network statement must match the mask length of prefixes in the routing table. This means that the specified network must be available and active in the local IP routing table.
Copyright © 2024 Pica8 Inc. All Rights Reserved.