Configuring a Logical Interface
This section describes the procedures for configuring a logical interface.
- Configuring a Loopback Interface
The loopback interface is always Up to ensure network reliability. - Configuring a NULL Interface
A NULL interface is always Up once created automatically by the system. It does not forward packet but can be used to filter packet.
Configuring a Loopback Interface
The loopback interface is always Up to ensure network reliability.
Context
The loopback interface has the following features:
- The loopback interface is always Up and has the loopback feature.
- The loopback interface can be configured with the mask of all 1s.
Based on the preceding features, the loopback interface has the following applications.
- The IP address of a loopback interface is specified as the source address of packets to improve network reliability.
- When no Router ID is configured for dynamic routing protocols, the maximum IP address of the loopback interface is configured as the router ID automatically.
- The loopback interface is configured as the source interface to send boarder gateway protocol (BGP) packets to ensure that the BGP session functions correctly when the physical interface is faulty.
- The loopback interface can be configured with the mask of 255.255.255.255 to save IP address resources.
Pre-Configuration
Before configuring a loopback interface, complete the following task:
Powering on the device and performing self-check
Procedure
- Run:
system-view
The system view is displayed.
- Run:
interface loopback loopback-number
A loopback interface is created and the loopback interface view is displayed.
You can create or delete loopback interface dynamically. After a loopback interface is created, the link-layer protocol is always up unless the loopback interface is deleted.
- Run:
ip address ip-address { mask | mask-length }
The IP address of the loopback interface is configured.
- Run:
commit
Commit the configuration.
Configuring a NULL Interface
A NULL interface is always Up once created automatically by the system. It does not forward packet but can be used to filter packet.
Context
A NULL0 interface is created automatically. The NULL0 interface is always Up and cannot forward packets. Any packets sent to the NULL0 interface are discarded. If the next hop of a static route to a network segment is a null interface, all the data packets destined for this network segment are discarded. Therefore, the packets that you want to filter out can be sent to the NULL0 interface directly without configuring the access control list.
For example, run the following static route configuration command to discard packets sent to the network segment of 192.101.0.0.
[~HUAWEI] ip route-static 192.101.0.0 255.255.0.0 NULL 0
Pre-Configuration
Before configuring a NULL interface, complete the following task:
Powering on the device and performing self-check