BGP MD5 authentication
BGP uses TCP as its transport layer protocol and considers a TCP packet valid if the source IP address, destination IP address, source port number, destination port number, and TCP sequence number in the packet are correct. Most of the preceding parameters in a TCP packet can be obtained by attackers without much difficulty. To protect BGP from attacks, you can configure MD5 authentication over TCP between BGP peers.
The cleartext passwords configured on both ends must be the same. If the interval between the configuration completions of the two devices is greater than hold-time, the peer relationship is interrupted. Otherwise, the peer relationship is not interrupted.
To prevent an MD5 password configured for a BGP peer from being cracked, change the password periodically.
The MD5 algorithm is not recommended if high security is required.
Keychain authentication
A keychain consists of multiple authentication keys, each of which contains an ID and a password. Each key in a keychain has a lifecycle, and keys are dynamically selected based on the lifecycle of each key. After a keychain with the same rules is configured on the two ends of a BGP session, authentication keys are dynamically selected to enhance BGP attack defense.
The TCP authentication option (TCP-AO) is used to authenticate received and to-be sent packets during TCP session establishment and data exchange. It supports packet integrity check to prevent TCP replay attacks. TCP-AO authentication improves the security of the TCP connection between BGP peers and is applicable to the network that requires high security.
BGP GTSM
GTSM checks TTL values to defend against attacks. Attackers may simulate BGP messages and continuously send them to the router. After receiving these packets, the interface board on the router sends these messages directly to the control plane for BGP processing, without validating them, if they are destined for the device. The router becomes extremely busy, and CPU usage is high because the control plane of the router needs to process these unchecked messages.
GTSM protects the router by checking whether the TTL value within the IP packet header is in a pre-defined range to improve system security.
BGP whitelist
The application layer association module checks protocol packets sent to the CPU and sends protocol packets that match the whitelist at a high rate.
CP-CAR
For enabled services or protocols, a device can limit the rate at which packets are sent to the CPU, protecting the CPU from attacks and ensuring proper network operating.
The function of whitelist session-CAR for BGP sets an independent CAR channel for each BGP session to ensure that the bandwidth of each BGP session is not preempted by other traffic (including traffic from other sessions of the same protocol and traffic from other protocols). When BGP messages suffer a traffic burst, you can adjust the default parameters of whitelist session-CAR for BGP if they do not meet service requirements. This ensures that BGP messages can be sent properly.
Route over-threshold control
In most cases, a BGP routing table contains a large number of routes. If a lot of routes are received from a peer, excessive system resources may be consumed. To prevent this issue, you can set the maximum number of routes that the local BGP device can accept from the peer.
Limit on the quantity of AS numbers in the AS_Path attribute
When a BGP device receives a route, it checks whether the quantity of AS numbers in the AS_Path attribute exceeds a specified threshold. If the quantity exceeds the threshold, the device discards the route. During route advertisement, the device also checks whether the quantity of AS numbers in the AS_Path attribute exceeds the threshold. If the quantity exceeds the threshold, the device does not advertise the route to prevent maliciously constructed error packets with an extra-long AS_Path list from attacking the router.
RPKI
Resource Public Key Infrastructure (RPKI) improves BGP/BGP4+ security by validating the origin ASs of BGP/BGP4+ routes.
RPKI is mainly applied to the networking where an RPKI server exists and the origin ASs of BGP/BGP4+ routes needs to be validated. In addition, you can apply the validation result to BGP/BGP4+ route selection to ensure that hosts in the local AS can securely communicate with hosts in other ASs.
BMP
The BGP/BGP4+ Monitoring Protocol (BMP) monitors BGP/BGP4+ running status, such as peer relationship establishment and termination and route updates.
Without BGP/BGP4+ Monitoring Protocol (BMP), manual query is required if you want to know about BGP/BGP4+ running status. To improve the network monitoring efficiency, you can configure BMP on a device to use a monitoring server on the network to monitor the BGP/BGP4+ running status.
The Transport Layer Security (TLS) protocol, as the SSL successor, ensures data integrity and privacy. SSL/TLS authentication can be configured on an SSL server so that BGP messages are encrypted to ensure data transmission security on the network.
DoS attacks
Attackers can send various types of packets to attack devices. If the packets are multicast protocol packets or the destination IP address is the IP address of an interface (including the loopback interface) on the device, the device sends these packets to the CPU. These packets consume the CPU and system resources, causing DoS attacks. After a BGP session is created, the system sends a whitelist. The application layer association module checks the received protocol packets and sends protocol packets that match the whitelist at a high rate. The module sends protocol packets that do not match the whitelist at the default bandwidth and rate to prevent DoS attacks. In addition, CP-CAR applies to interfaces to limit the transmission rate of BGP packets, to protect the CPU from attacks, and to ensure proper network operations.
Injection of a large number of BGP routes
BGP runs on various models of devices, such as the IASs on an access network and NetEngine 8000 Fs. The number of BGP routes is determined by the CPU and memory of a device. If the number of BGP routes received by a device exceeds the capacity of the device, the device cannot run properly, and services cannot be provided properly because the memory of the device is exhausted. The maximum number of routes for a single peer can be set. If attackers inject a large number of routes and the quantity exceeds the value specified by the maximum number of routes for a single peer, the excess routes are discarded to prevent exhaustion of system resources.
Construction of error BGP messages
Attackers may construct various types of error packets, such as packets with extra-long AS_Paths, packets with incorrect packet headers, packets with incorrect lengths, and packets with invalid next hops. The attackers use these error packets to attack devices. BGP implements a policy "tolerant on input and strict on output". The device discards error packets without interrupting connections to peers to ensure uninterrupted services. For packets with extra-long AS_Paths, an AS_Path limit is set. During route reception or advertisement, if the device finds that the AS_Path exceeds the limit, it refuses to accept or advertise routes.
A BGP Update message contains various path attributes. If a local device receives Update messages containing malformed path attributes, the involved BGP sessions may flap. To resolve this issue and enhance reliability, run the peer path-attribute-treat command to configure a special mode in which the device processes specified path attributes in received BGP Update messages. Special modes indicate those that are not defined in a standard protocol.
Network packet attacks
It is easy for attackers to obtain the majority of parameters in the quintuple of a packet. To protect BGP from attacks, take the following measures:
Use TCP MD5 authentication between BGP peers to reduce the possibility of being attacked.
Configure keychain authentication for BGP sessions to enhance BGP anti-attack performance.
Configure the GTSM function to check TTLs in messages to prevent attacks.
An MD5 authentication password is configured for TCP connections, and TCP implements MD5 authentication of BGP. If authentication fails, no TCP connections can be established.
Configure keychain authentication on both ends of a BGP peer relationship. In addition, the configured keychains must use the same encryption algorithm and password so that TCP connections can be set up, and BGP messages can be exchanged properly.
TCP-AO authentication must be configured on both BGP peers. A TCP-AO authentication password needs to be set for a TCP connection, and the authentication is performed by TCP. If authentication fails, no TCP connections can be established.
GTSM protects routers from attacks by checking whether the TTL in the header of an IP packet is in the pre-defined range.
Perform the following steps on a GTSM-enabled router:
Enable RPKI and configure RPKI session parameters on a client.
Apply the BGP origin AS validation result to route selection.
Configure the device to perform ROA on the routes to be advertised to an EBGP peer to control BGP route advertisement.
Apply the BGP regional validation result to BGP route selection.
The Secure Sockets Layer (SSL) protocol protects data privacy based on the Internet. It allows a client and a server to communicate in a way designed to prevent eavesdropping. Specifically, to ensure data transmission security on a network, a BGP peer or peer group needs to be configured as an SSL client or as a server, and the SSL data encryption, identity authentication, and message integrity verification mechanisms need to be used.
The peer as-number command has been run to create a peer.
SSL/TLS certification can be enabled only on servers. BGP MD5 authentication is mutually exclusive with BGP keychain authentication and only one of them can be configured for a BGP peer.
The configuration of a peer takes precedence over that of the peer group to which the peer belongs.
SSL/TLS certification takes effect only when SSL/TLS certification is enabled on the server (SSL/TLS certification is not required on the client), the SSL client and server are configured, SSL policies are applied to the client and server.