- Table of Contents
- Related Documents
-
| Title | Size | Download |
|---|---|---|
| 02-Loopback and null interface configuration | 61.38 KB |
Contents
Configuring loopback and null interfaces
Configuring a loopback interface
Displaying and maintaining loopback and null interfaces
This chapter describes how to configure a loopback interface and a null interface.
Configuring a loopback interface
A loopback interface is a virtual interface. The physical layer state and link layer protocols of a loopback interface are always up unless the loopback interface is manually shut down. Because of this benefit, loopback interfaces are widely used in the following scenarios:
· Configuring a loopback interface address as the source address of the IP packets that the device generates—Because loopback interface addresses are stable unicast addresses, they are usually used as device identifications. When you configure a rule on an authentication or security server to permit or deny packets that a device generates, you can simplify the rule by configuring it to permit or deny packets carrying the loopback interface address that identifies the device. When you use a loopback interface address as the source address of IP packets, make sure 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 packets sent to the device itself, so the device does not forward these packets.
· Using a loopback interface in dynamic routing protocols—With no router ID configured for a dynamic routing protocol, the system selects highest loopback interface IP address selected as the router ID. In BGP, to avoid interruption of BGP sessions due to physical port failure, you can use a loopback interface as the source interface of BGP packets.
To configure a loopback interface:
|
Step |
Command |
Remarks |
|
1. Enter system view. |
system-view |
N/A |
|
2. Create a loopback interface and enter loopback interface view. |
interface loopback interface-number |
N/A |
|
3. Set the interface description. |
description text |
The default setting is interface name Interface (for example, LoopBack1 Interface). |
|
4. Restore the default settings for the loopback interface. |
default |
N/A |
|
5. Bring up the loopback interface. |
undo shutdown |
By default, a loopback interface is up. |
Configuring a null interface
A null interface is a virtual interface and is always up, but you can neither use it to forward data packets nor can you configure it with an IP address or link layer protocol. The null interface provides a simpler way to filter packets than ACL. You can filter undesired traffic by transmitting it to a null interface instead of applying an ACL. For example, if you specify a null interface as the next hop of a static route to a specific network segment, any packets routed to the network segment are dropped.
To configure a null interface:
|
Step |
Command |
Remarks |
|
1. Enter system view. |
system-view |
N/A |
|
2. Enter null interface view. |
interface null 0 |
Interface Null 0 is the default null interface on the device and cannot be manually created or removed. Only one null interface, Null 0, is supported on the device. The null interface number is fixed at 0. |
|
3. Set the interface description. |
description text |
The default setting is NULL0 Interface. |
|
4. Restore the default settings for the null interface. |
default |
N/A |
Displaying and maintaining loopback and null interfaces
Execute display commands in any view and reset commands in user view.
|
Task |
Command |
|
Display information about the specified or all loopback interfaces. |
display interface [ loopback [ interface-number ] ] [ brief [ description ] ] |
|
Display information about the null interface. |
display interface [ null [ 0 ] ] [ brief [ description ] ] |
|
Clear the statistics on the specified or all loopback interfaces. |
reset counters interface loopback [ interface-number ] |
|
Clear the statistics on the null interface. |
reset counters interface [ null [ 0 ] ] |
configuring
loopback interface, 1
null interface, 1
displaying
loopback interface, 2
null interface, 2
interface
configuring loopback, 1
configuring null, 1
loopback
displaying interface, 2
maintaining interface, 2
maintaining
loopback interface, 2
null interface, 2
network management
loopback interface configuration, 1
null interface configuration, 1
null interface
configuration, 1
displaying, 2
maintaining, 2
procedure
configuring loopback interface, 1
configuring the null interface, 1
displaying loopback interface, 2
displaying null interface, 2
maintaining loopback interface, 2
maintaining null interface, 2
switching
loopback interface configuration, 1
null interface configuration, 1
