eNSP Basic Notes

Published 2022-11-26 20:21 3083 words 16 min read

Beginner notes for getting started with eNSP

eNSP

Basic Commands

OSPF

When configuring OSPF, in order to make it easier to calculate the cost value, the following is usually used:

bandwidth-reference(OSPF)

#reference
<HUAWEI> system-view
[HUAWEI] ospf 100
[HUAWEI-ospf-100] bandwidth-reference 1000

When establishing EBGP and checking the BGP routing table, if you cannot receive the route information of the Loopback interface, it is because the OSPF priority is higher than that of the BGP protocol, and then routers in IBGP will not advertise the route beyond the local router (i.e., the next-hop address) inside IBGP, nor will they pass it to EBGP neighbors, which results in unreachability.

Solution: On the EBGP router that needs the configuration, configure a static aggregate route whose next hop is the peer’s IBGP route IP (but doing so involves a large amount of overall work).

ip route-static 0.0.0.0   0.0.0.0      X.X.X.X
                Destination    Mask    (Peer next-hop IP)

BGP

On the internal network, the OSPF routing protocol needs to be configured so that the source address of BGP packets is reachable when establishing IBGP neighbors.

When configuring OSPF, you need to network the IP networks inside the AS; there is no need to advertise other external networks, that is, EBGP.

  • Verify the OSPF protocol: display ip routing-table protocol ospf

When configuring a BGP peer, the peer IP is the remote end’s IP used to create the BGP peer.

For the EBGP on the remote end, network is required; otherwise the connection cannot be established.

peer next-hop-local

Function: This command is used to set the next-hop attribute to the device’s own IP address when advertising routes to an IBGP peer (or peer group).

Usage: The peer next-hop-local command is generally configured on an ASBR. When a device learns a route from an EBGP neighbor and then forwards it to other IBGP neighbors, the next hop is not modified by default, but the next hop of the route sent by its EBGP neighbor is always the Peer address of that EBGP neighbor. After an IBGP neighbor in the same AS as the local peer receives such a route, the route cannot become active because the next hop is unreachable.

In short: Roughly speaking, the device learns a route from an EBGP neighbor and advertises it to the internal IBGP peers, but it does not modify the next hop when advertising to IBGP, meaning the internal network receives a route from EBGP but IBGP does not recognize that IP. Therefore, the next hop of the route advertised to IBGP neighbors is modified to the device’s own address. After an IBGP neighbor receives such a route (since an IGP is configured within the AS), it finds the next hop reachable and connectivity is established.

peer reflect-client

Function: The peer reflect-client command is used to configure the local device as a route reflector and the peer (or peer group) as a client of the route reflector.

Usage: To ensure connectivity between IBGP peers, a full-mesh relationship needs to be established among IBGP peers. Assuming there are n wireless access controllers within an AS, the number of IBGP connections that should be established is n(n-1)/2.

When the number of IBGP peers is large, the consumption of network resources and CPU resources is very high. Route reflection can solve this problem. To ensure connectivity between IBGP peers, a full-mesh relationship needs to be established among IBGP peers. Assuming there are n wireless access controllers within an AS, the number of IBGP connections that should be established is n(n-1)/2. When the number of IBGP peers is large, the consumption of network resources and CPU resources is very high. Route reflection can solve this problem.

In short: IBGP peers do not need to establish a full-mesh relationship. Configure all interconnected routers as BGP route reflectors, and the other devices connecting to them act as clients.

aggregate

Function: The aggregate command is used to create an aggregate route in the BGP routing table.

Usage: BGP route aggregation is divided into manual aggregation and automatic aggregation. The aggregate command is used to implement manual aggregation. This command can aggregate the routes in the local BGP routing table. The priority of manually aggregated routes is higher than that of automatically aggregated routes.

If the specific routes contained in an aggregate route have different Origin attributes, the Origin attribute of the aggregate route follows the priority igp > egp > incomplete. The aggregate route carries the community attributes of all the original specific routes.

By setting the keyword as-set, you can create an aggregate route whose Autonomous System (AS) path includes the AS path information of the specific routes. Use this keyword with caution when aggregating many AS paths, because when the specific routes change frequently, it can cause route flapping.

The keyword detail-suppressed suppresses all the specific routes contained in the aggregate route and only advertises the aggregate route. The generated aggregate route carries the Atomic-aggregate attribute and cannot carry the community attributes of the original specific routes.

The keyword suppress-policy can generate an aggregate route but suppresses the advertisement of specified routes. You can use the if-match clause of route-policy to selectively suppress some specific routes, that is, the routes matching the policy will be suppressed, while other specific routes that do not pass the policy are still advertised. You can also achieve the same effect by using the peer route-policy command to configure a policy that you do not want to advertise to peers.

The keyword origin-policy generates an aggregate route only when the route-policy matches.

The keyword attribute-policy can set the attributes of the aggregate route. If the apply as-path command is used in the policy to configure the AS_Path attribute, and the aggregate command has the keyword as-set set, then the apply as-path command in the policy will not take effect. The same task can also be accomplished through the peer route-policy command.

In short: In the BGP view, use the aggregate command to configure manual route summarization. aggregate can flexibly specify the destination network mask length of the summary route and is not limited by the network address class.

The basic usage is: aggregate x.x.x.x 掩码 as-set

Adding detail-suppressed at the end means only advertising the summary route and suppressing the detailed routes. Roughly it is aggregate x.x.x.x 掩码 detail-suppressed

  1. The aggregate detail-suppressed as-set command configures route summarization. Adding the as-set keyword after the detail-suppressed keyword means that the summary route is advertised while the detailed routes are suppressed, but as-set inherits the path attributes of the detailed routes, especially the AS-Path attribute; the AS-Path attribute also plays a loop-prevention role.
  2. Use the suppress-policy keyword (suppression policy) in the aggregate command. This keyword is used to advertise the summary route as well as the selected detailed routes; in other words, it selectively suppresses detailed routes.
  3. Use the origin-policy keyword in the aggregate command.

peer route-policy

Function: The peer route-policy command is used to specify a Route-Policy for routes received from a peer (or peer group) or routes advertised to a peer (or peer group).

Usage: After creating a route policy, use the peer route-policy command to apply the route policy to the specified peer. This controls the routes received from the peer (or peer group) or advertised to the peer (or peer group), so that only the routes needed locally are received or only the routes needed by the remote end are advertised, achieving the purpose of route management; at the same time, it can also reduce the size of the routing table and reduce the consumption of system resources.

peer { group-name | ipv4-address } route-policy route-policy-name { import | export }

In short: Just like the above.

#reference
#Apply a Route-Policy named AA to the routes from the peer
<AC6605> system-view
[AC6605] bgp 100
[AC6605-bgp] peer 10.1.1.2 as-number 200
[AC6605-bgp] ipv4-family unicast
[AC6605-bgp-af-ipv4] peer 10.1.1.2 route-policy AA import

peer advertise-community

Function: Used to configure advertising community attributes to a peer (or peer group).

Usage: By executing the peer advertise-community command, you can control whether community attributes are advertised to a peer or peer group. If community attributes are advertised to a peer group, all peers in the peer group inherit this configuration, which simplifies the application of route policies and reduces the difficulty of maintenance and management.

In short: It is about BGP communities. After using this, the device sends its own community attributes to the peer or peer group, and so on.

#reference

[Huawei]bgp 100 //Start BGP, specify the local AS number, and enter the BGP view

[Huawei-bgp]router-id 1.1.1.1 //Configure the BGP Router ID

[Huawei-bgp]peer 2.2.2.2 as-number 100 //Create a BGP peer

[Huawei-bgp]peer 2.2.2.2 connect-interface GigabitEthernet 0/0/1 //Specify the source interface for establishing TCP connection sessions between BGP peers

[Huawei-bgp]peer 3.3.3.3 ebgp-max-hop 1 //Specify the maximum number of hops allowed for establishing an EBGP connection; the default is 1, meaning EBGP connections can only be established on physically directly connected links

[Huawei-bgp]peer 2.2.2.2 description a1 //Configure the description information of the specified peer

[Huawei-bgp]ipv4-family multicast //Enter the BGP-IPv4 multicast address family view

[Huawei-bgp-af-multicast]peer 2.2.2.2 enable //Enable the MP-BGP function on the existing BGP peer, making it an MP-BGP peer

[Huawei-bgp]ipv6-family //Enter the BGP-IPv6 unicast address family view

[Huawei-bgp-af-ipv6]peer 3.3.3.3 enable //Enable the MP-BGP function on the existing BGP peer, making it an MP-BGP peer

[Huawei-bgp]group a1 //Create a peer group

[Huawei-bgp]peer a2 as-number 200 //Configure the AS number of the EBGP peer group

[Huawei-bgp]peer 1.1.1.1 group a1 //Add a peer to the peer group

[Huawei-bgp]peer a2 connect-interface GigabitEthernet 0/0/1 //Specify the source interface and source address for establishing TCP connection sessions between BGP peers; by default, the outgoing interface of the packet is used as the source interface of BGP packets

[Huawei-bgp]peer a2 ebgp-max-hop 1 //Specify the maximum number of hops allowed for establishing an EBGP connection; by default, EBGP connections can only be established on physically directly connected links, and the maximum number of hops allowed for an EBGP connection is 1

[Huawei-bgp]ipv4-family unicast //Enter the IPv4 address family view

[Huawei-bgp-af-ipv4]import-route ospf 1 //Configure BGP to import routes from other protocols

[Huawei-bgp-af-ipv4]default-route imported //Allow BGP to import the default route that already exists in the local IP routing table

[Huawei-bgp-af-ipv4]network 10.1.1.1 //Configure BGP to import routes from the routing table one by one

[Huawei]display bgp peer //Display information about all BGP peers

[Huawei]display bgp peer 10.1.1.1 verbose //Display information about the specified BGP peer

[Huawei]display bgp routing-table //Display BGP routing information

[Huawei]display bgp group //Display peer group information

[Huawei]display bgp multicast peer //Display MBGP peer information

[Huawei]display bgp multicast group //Display MBGP peer group information

[Huawei]display bgp multicast routing-table //Display MBGP routing table information

[Huawei-bgp]peer 2.2.2.2 password cipher abc123 //Configure the MD5 authentication password

[Huawei]display bgp peer verbose //Display detailed authentication information of BGP peers

[Huawei-bgp-af-ipv4]peer 2.2.2.2 reflect-client //Set the route reflector and its clients

[Huawei-bgp-af-ipv4]reflector cluster-id 1.1.1.1 //Configure the cluster ID of the route reflector; by default, each route reflector uses its own Router ID as the cluster ID

[Huawei-bgp-af-ipv4]undo reflect between-clients //Disable route reflection between clients; it is enabled by default

[Huawei-bgp]confederation id 1 //Configure the confederation ID; not configured by default

[Huawei-bgp]confederation peer-as 1 //Specify the sub-AS number that belongs to the same confederation

[Huawei-bgp]confederation nonstandard //Configure the compatibility of the confederation; the default is consistent with RFC3065

[Huawei-bgp-af-ipv4]filter-policy 2000 export //Based on the access control list (ACL), configure BGP to filter the route information advertised globally

[Huawei-bgp-af-ipv4]filter-policy ip-prefix 1 export //Based on the address prefix list, configure BGP to filter the route information advertised globally

[Huawei-bgp-af-ipv4]peer 2.2.2.2 filter-policy 2000 export //Based on the access control list (ACL), configure filtering of the route information advertised to a specific peer (or peer group)

[Huawei-bgp-af-ipv4]peer 2.2.2.2 ip-prefix 1 export //Based on the prefix list, configure filtering of the route information advertised to a specific peer (or peer group)

[Huawei-bgp-af-ipv4]peer 2.2.2.2 as-path-filter 1 export //Based on the AS path filter, configure filtering of the route information advertised to a specific peer (or peer group)

[Huawei-bgp-af-ipv4]peer 2.2.2.2 route-policy a1 export //Based on Route-Policy, configure filtering of the route information advertised to a specific peer (or peer group)

[Huawei-bgp-af-ipv4]filter-policy 2000 import //Based on the access control list (ACL), configure BGP to receive routes globally

[Huawei-bgp-af-ipv4]filter-policy ip-prefix 1 import //Based on the address prefix list, configure BGP to receive routes globally

[Huawei-bgp-af-ipv4]peer 2.2.2.2 filter-policy 2000 import //Based on the access control list (ACL), configure receiving routes from a specific peer (or peer group)

[Huawei-bgp-af-ipv4]peer 2.2.2.2 ip-prefix 1 import //Based on the prefix list, configure receiving routes from a specific peer (or peer group)

[Huawei-bgp-af-ipv4]peer 2.2.2.2 as-path-filter 1 import //Based on the AS path filter, configure receiving routes from a specific peer (or peer group)

[Huawei-bgp-af-ipv4]peer 2.2.2.2 route-policy a1 import //Based on Route-Policy, configure receiving routes from a specific peer (or peer group)

[Huawei-bgp-af-ipv4]peer 2.2.2.2 route-limit 10 //Set the maximum number of routes allowed to be received from a peer (or peer group)

[Huawei-bgp]peer 2.2.2.2 capability-advertise route-refresh //Enable the Route-refresh capability for BGP peers that support it; it is enabled by default

refresh bgp 2.2.2.2 export //Trigger a BGP soft reset

[Huawei-bgp-af-ipv4]peer 2.2.2.2 keep-all-routes //For BGP peers that do not support the Route-refresh capability, retain all route update information of the peer (or peer group); by default, only the route update information from the peer (or peer group) that passes the inbound policy is saved

[Huawei]display ip as-path-filter //Display information about the configured AS path filters

[Huawei]display ip community-filter //Display information about the configured extended community attribute filters

[Huawei]display bgp routing-table as-path-filter 1 //Display route information matching the specified AS path filter

[Huawei]display ip extcommunity-filter //Display information about the configured extended community attribute filters

[Huawei]display bgp routing-table community-filter 1 //Display routes matching the specified BGP community attribute filter

[Huawei]display bgp multicast routing-table different-origin-as //Display MBGP routes whose source AS is different

[Huawei]display bgp multicast routing-table regular-expression a1 //Display MBGP route information matching the AS regular expression

[Huawei]display bgp multicast paths //Display AS path information

[Huawei]display bgp multicast routing-table as-path-filter 1 //Display MBGP route information matching the filter list

[Huawei]display bgp multicast routing-table community-filter 1 //Display routes matching the specified MBGP community list

[Huawei]display bgp multicast routing-table peer 2.2.2.2 received-routes //Display the route information received from or sent to the specified MBGP peer

[Huawei]display bgp multicast network //Display the advertised MBGP route information

[Huawei-bgp]timer connect-retry 32 //Configure the BGP global connection retry timer; the default is 32 seconds

[Huawei-bgp]peer 2.2.2.2 timer connect-retry 32 //Configure the connection retry timer of a peer or peer group; the default is 32 seconds

[Huawei-bgp]timer keepalive 60 hold 180 //Configure BGP timers; a reasonable maximum Keepalive message send interval is one-third of the hold time, and the default keepalive time is 60 seconds and the hold time is 180 seconds

[Huawei-bgp]peer 2.2.2.2 timer keepalive 60 hold 180 //Configure the keepalive send interval and hold time of a peer or peer group

[Huawei-bgp-af-ipv4]peer 2.2.2.2 route-update-interval 15 //Configure the update message timer; by default, the update message timer is 15 seconds for IBGP peers and 30 seconds for EBGP peers

[Huawei-bgp]undo ebgp-interface-sensitive //Disable fast reset of EBGP connections; it is enabled by default

[Huawei-bgp]nexthop recursive-lookup delay 5 //Configure the delay time for urgent and non-urgent recursive resolution result changes; the default is 5 seconds

[Huawei-bgp-af-ipv4]dampening //Configure BGP route dampening parameters; it only takes effect on EBGP routes

[Huawei]display bgp routing-table dampened //Display dampened BGP routes

[Huawei]display bgp routing-table dampening parameter //Display the configured BGP route dampening parameters

[Huawei]display bgp routing-table flap-info //Display route flap statistics

[Huawei]display bgp multicast routing-table dampened //Display dampened MBGP routes

[Huawei]display bgp multicast routing-table dampening parameter //Display MBGP dampening parameter information

[Huawei]display bgp multicast routing-table flap-info //Display MBGP route flap statistics

[Huawei]display bgp multicast routing-table flap-info regular-expression a1 //Display MBGP route flap statistics

[Huawei-bgp]peer 2.2.2.2 tracking //Enable the BGP Tracking function for the specified peer; it is disabled by default

[Huawei-bgp]peer 2.2.2.2 bfd enable //Configure the BFD function of a peer or peer group, and establish a BFD session using the default BFD parameter values

[Huawei-bgp]peer 2.2.2.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 3 //Specify the parameter values for establishing the BFD session

[Huawei-bgp]peer 2.2.2.2 bfd block //Prevent the peer from inheriting the BFD function from the peer group

[Huawei]display bgp bfd session all //Display the BFD session information established by BGP

[Huawei]display bgp peer //Display BGP peer information

[Huawei]display bgp group a1 //Display BGP peer group information

[Huawei]display bgp vpnv4 all group a1 //Display BGP peer group information of VPNv4

[Huawei-bgp]graceful-restart //Enable the GR capability of the BGP protocol; it is disabled by default

[Huawei-bgp]graceful-restart timer wait-for-rib 600 //

Configure the time that the Restarting Speaker and the Receiving Speaker wait for the End-of-RIB message; by default, the time to wait for the End-of-RIB message is 600 seconds

[Huawei]display bgp peer verbose //Display the BGP GR status

[Huawei-bgp-af-ipv4]summary automatic //Automatically configure the aggregation of subnet routes by natural network segments

[Huawei-bgp-af-ipv4]aggregate 10.1.1.1 16 //Manually advertise all aggregate routes and the aggregated routes

[Huawei-bgp-af-ipv4]aggregate 10.1.1.1 16 detail-suppressed //Manually advertise only the aggregate routes

[Huawei-bgp-af-ipv4]aggregate 10.1.1.1 16 suppress-policy a1 //Manually advertise only the aggregate routes and the aggregated routes that pass the route policy

[Huawei-bgp-af-ipv4]aggregate 10.1.1.1 16 as-set //Manually advertise only the aggregate routes with loop detection enabled

[Huawei-bgp-af-ipv4]aggregate 10.1.1.1 16 attribute-policy a1 //Manually set the attributes of the aggregate route

[Huawei-bgp-af-ipv4]aggregate 10.1.1.1 16 origin-policy a1 //Manually generate aggregate routes only from the routes that pass the route policy

[Huawei-bgp-af-ipv4]peer 2.2.2.2 default-route-advertise //Send the default route to a peer or peer group

[Huawei-bgp]ipv4-family unicast //Enter the BGP-IPv4 unicast address family view

[Huawei-bgp]ipv4-family vpn-instance 1 //Enter the BGP-VPN instance IPv4 address family view

[Huawei-bgp]ipv4-family multicast //Enter the BGP-IPv4 multicast address family view

reset bgp all //Reset BGP connections; this will interrupt the BGP peer relationships between switches

reset bgp 100 //Reset the BGP connections with the specified AS

reset bgp 2.2.2.2 //Reset the BGP connection with the specified peer

reset bgp external //Reset all EBGP connections

reset bgp group a1 //Reset the BGP connections with the specified peer group

reset bgp internal //Reset all IBGP connections

reset bgp multicast 2.2.2.2 //Reset the MBGP connection with the specified peer

reset bgp multicast all //Reset all MBGP connections

reset bgp multicast group a1 //Reset the MBGP connections among all peers in the same peer group

reset bgp multicast external //Reset external connections

reset bgp multicast internal //Reset internal connections

BGP Route Reflection

Route reflection: when the route reflector receives a route, it reflects the route to other clients, non-clients, and other EBGP (neighbors).

If you enjoyed this, leave a comment~

... Page views
© 2021 - 2026 Vullfin @VV
Powered by theme astro-koharu · Inspired by Shoka