Loopback and null interface configuration
Loopback interface
A loopback interface is a software-only virtual interface. It delivers the following benefits.
The physical layer state and link layer protocols of a loopback interface are always up unless the
•
loopback interface is shut down manually.
Assign a loopback interface an IP address with an all-F mask to save the IP address resources.
•
When you assign an IPv4 address whose mask is not 32-bit, the system automatically changes the
mask into a 32-bit mask. When you assign an IPv6 address whose mask is not 128-bit, the system
automatically changes the mask into a 128-bit mask.
You can enable routing protocols on a loopback interface, and a loopback interface can send and
•
receive routing protocol packets.
Because of the benefits mentioned above, loopback interfaces are widely used in the following scenarios.
Configure a loopback interface address as the source address of the IP packets that the switch
•
generates. Because loopback interface addresses are stable unicast addresses, they are usually used
as device identifications. Therefore, when you configure a rule on an authentication or security
server to permit or deny packets generated by a switch, you can simplify the rule by configuring it to
permit or deny packets carrying the loopback interface address identifying the switch.
Note that, when you use a loopback interface address as the source address of IP packets, make
sure that the route from the loopback interface to the peer is reachable by performing routing
configuration. All data packets sent to the loopback interface are considered as packets sent to the
switch itself, so the switch does not forward these packets.
Because a loopback interface is always up, it can be used in dynamic routing protocols. For
•
example, if no router ID is configured for a dynamic routing protocol, the highest loopback interface
IP address is selected as the router ID. In BGP, to avoid BGP sessions being interrupted by physical
port failure, you can use a loopback interface as the source interface of BGP packets.
Configuring a loopback interface
To configure a loopback interface:
To do...
1.
Enter system view
2.
Create a Loopback interface
and enter Loopback interface
view
3.
Set a description for the
loopback interface
Use the command...
system-view
interface loopback interface-
number
description text
22
Remarks
—
—
Optional.
By default, the description of an
interface is the interface name
followed by the "Interface" string.