- Table of Contents
-
- 03-Layer 2—LAN Switching Command Reference
- 00-Preface
- 01-Ethernet interface commands
- 02-Loopback, null, and inloopback interface commands
- 03-Bulk interface commands
- 04-MAC address table commands
- 05-Ethernet link aggregation commands
- 06-Port isolation commands
- 07-Spanning tree commands
- 08-Loop detection commands
- 09-VLAN commands
- 10-MVRP commands
- 11-QinQ commands
- 12-VLAN mapping commands
- 13-LLDP commands
- 14-L2PT commands
- 15-Service loopback group commands
- Related Documents
-
Title | Size | Download |
---|---|---|
02-Loopback, null, and inloopback interface commands | 88.32 KB |
Loopback, null, and inloopback interface commands
bandwidth
Use bandwidth to set the expected bandwidth for an interface.
Use undo bandwidth to restore the default.
Syntax
bandwidth bandwidth-value
undo bandwidth
Default
The expected bandwidth of a loopback interface is 0 kbps.
Views
Loopback interface view
Predefined user roles
network-admin
Parameters
bandwidth-value: Specifies the expected bandwidth in the range of 1 to 400000000 kbps.
Usage guidelines
The expected bandwidth is an informational parameter used only by higher-layer protocols for calculation. You cannot adjust the actual bandwidth of an interface by using this command.
Examples
# Set the expected bandwidth of Loopback 1 to 1000 kbps.
<Sysname> system-view
[Sysname] interface loopback 1
[Sysname-LoopBack1] bandwidth 1000
default
Use default to restore the default settings for an interface.
Syntax
default
Views
Loopback interface view
Null interface view
Predefined user roles
network-admin
Usage guidelines
|
CAUTION: The default command might interrupt ongoing network services. Make sure you are fully aware of the impact of this command before using it on a live network. |
This command might fail to restore the default settings for some commands for reasons such as command dependencies and system restrictions. Use the display this command in interface view to identify these commands, and then use their undo forms or follow the command reference to restore their default settings. If your restoration attempt still fails, follow the error message instructions to resolve the problem.
Examples
# Restore the default settings for Loopback 1.
<Sysname> system-view
[Sysname] interface loopback 1
[Sysname-LoopBack1] default
description
Use description to configure the description of an interface.
Use undo description to restore the default.
Syntax
description text
undo description
Default
The interface description uses the interface name Interface format, for example, LoopBack1 Interface.
Views
Loopback interface view
Null interface view
Predefined user roles
network-admin
Parameters
text: Specifies the description, a case-sensitive string of 1 to 255 characters.
Usage guidelines
Configure a description for an interface for easy identification and management purposes.
You can use the display interface command to view the configured description.
Examples
# Configure the description of Loopback 1 as for RouterID.
<Sysname> system-view
[Sysname] interface loopback 1
[Sysname-LoopBack1] description for RouterID
display interface inloopback
Use display interface inloopback to display information about the inloopback interface.
Syntax
display interface inloopback [ 0 ] [ brief [ description | down ] ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
0: Specifies Inloopback 0.
brief: Displays brief interface information. If you do not specify this keyword, the command displays detailed interface information.
description: Displays complete interface descriptions. If you do not specify this keyword, the command displays only the first 27 characters of interface descriptions. The description of an inloopback interface is always InLoopBack0 Interface and cannot be configured.
down: Displays information about interfaces in down state and the causes. If you do not specify this keyword, the command displays information about interfaces in all states.
Usage guidelines
The device has only one inloopback interface Inloopback 0. If you specify the inloopback keyword, the command displays information about the interface Inloopback 0 regardless of whether you specify the 0 keyword.
Examples
# Display detailed information about Inloopback 0.
<Sysname> display interface inloopback
InLoopBack0
Current state: UP
Line protocol state: UP(spoofing)
Description: InLoopBack0 Interface
Maximum transmission unit: 1536
Physical: InLoopBack
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
Table 1 Command output
Field |
Description |
Current state |
Physical link state of the interface, which is always UP, meaning that the inloopback interface can receive and transmit packets. |
Line protocol state |
Data link layer state of the interface, which is always UP(spoofing). UP(spoofing) represents that the data link layer protocol of the interface is up, but the link is an on-demand link or does not exist. This attribute is typical of null interfaces and loopback interfaces. |
Description |
Description of the interface, which is always InLoopBack0 Interface and cannot be configured. |
Maximum transmission unit |
MTU of the interface, which is always 1536 and cannot be configured |
Physical: InLoopBack |
The physical type of the interface is inloopback. |
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec |
Average input rate during the last 300 seconds (displayed when the interface supports traffic statistics collection): · bytes/sec—Average number of bytes received per second. · bits/sec—Average number of bits received per second. · packets/sec—Average number of packets received per second. |
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec |
Average output rate over the last 300 seconds (displayed when the interface supports traffic statistics collection): · bytes/sec—Average number of bytes sent per second. · bits/sec—Average number of bits sent per second. · packets/sec—Average number of packets sent per second. |
Input: 0 packets, 0 bytes, 0 drops |
Total number and size (in bytes) of incoming packets of the interface and the number of dropped packets (displayed when the interface supports traffic statistics collection). |
Output: 0 packets, 0 bytes, 0 drops |
Total number and size (in bytes) of outgoing packets of the interface and the number of dropped packets (displayed when the interface supports traffic statistics collection). |
# Display brief information about Inloopback 0.
<Sysname> display interface inloopback 0 brief
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
InLoop0 UP UP(s) --
Table 2 Command output
Field |
Description |
Link |
Physical link state of the interface, which is always UP, meaning that the link is physically up. |
Protocol |
Data link layer protocol state of the interface, which is always UP(s). UP(s) represents that the data link layer protocol of the interface is up, but the link is an on-demand link or does not exist. The (s) attribute represents the spoofing flag. This value is typical of null interfaces and loopback interfaces. |
Primary IP |
IP address of the interface. Because inloopback interfaces do not support CLI configuration, this field does not display a value. |
Description |
Description of the interface. Because inloopback interfaces do not support CLI configuration, this field does not display a value. |
display interface loopback
Use display interface loopback to display information about the specified or all existing loopback interfaces.
Syntax
display interface loopback [ interface-number ] [ brief [ description | down ] ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
loopback interface-number: Specifies a loopback interface by its number, which can be the number of any existing loopback interface. If you do not specify this argument, the command displays information about all existing loopback interfaces on the device.
brief: Displays brief interface information. If you do not specify this keyword, the command displays detailed interface information.
description: Displays complete interface descriptions. If you do not specify this keyword, the command displays only the first 27 characters of interface descriptions.
down: Displays information about interfaces in down state and the causes. If you do not specify this keyword, the command displays information about interfaces in all states.
Usage guidelines
This command is supported only after a loopback interface is created.
Examples
# Display detailed information about Loopback 0. (In this example, the loopback interface supports traffic statistics collection.)
<Sysname> display interface loopback 0
LoopBack0
Current state: UP
Line protocol state: UP(spoofing)
Description: LoopBack0 Interface
Bandwidth: 1000 kbps
Maximum transmission unit: 1536
Internet protocol processing: Disabled
Physical: Loopback
Last clearing of counters: Never
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# Display detailed information about Loopback 0. (In this example, the loopback interface does not support traffic statistics collection.)
<Sysname> display interface loopback 0
LoopBack0
Current state: UP
Line protocol state: UP(spoofing)
Description: LoopBack0 Interface
Maximum transmit unit: 1536
Internet protocol processing : Disabled
Physical: Loopback
Last clearing of counters: Never
Field |
Description |
Current state |
Physical link state of the interface: · UP—The loopback interface can receive and transmit packets. · Administratively DOWN—The interface has been shut down by using the shutdown command. |
Line protocol state |
Data link layer state of the interface. UP (spoofing) means that the data link layer protocol of the interface is up, but the link is an on-demand link or does not exist. This attribute is typical of null interfaces and loopback interfaces. |
Description |
Description of the interface. |
Bandwidth |
Expected bandwidth of the interface. This field is not displayed when the value is 0. |
Maximum transmission unit |
MTU of the interface. |
Internet protocol processing: Disabled |
The interface is not assigned an IP address and cannot process IP packets. |
Internet address: 1.1.1.1/32 (primary) |
IP address of the interface. The primary attribute indicates that the address is the primary IP address. |
Physical: Loopback |
The physical type of the interface is loopback. |
Last clearing of counters |
Time when statistics on the logical interface were last cleared by using the reset counters interface command. If the statistics of the interface have never been cleared by using the reset counters interface command since the device started, this field displays Never. |
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec |
Average input rate during the last 300 seconds (displayed when the interface supports traffic statistics collection): bytes/sec—Average number of bytes received per second. bits/sec—Average number of bits received per second. packets/sec—Average number of packets received per second. |
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec |
Average output rate over the last 300 seconds (displayed when the interface supports traffic statistics collection): · bytes/sec—Average number of bytes sent per second. · bits/sec—Average number of bits sent per second. · packets/sec—Average number of packets sent per second. |
Input: 0 packets, 0 bytes, 0 drops |
Total number and size (in bytes) of incoming packets of the interface and the number of dropped packets (displayed when the interface supports traffic statistics collection). |
Output: 0 packets, 0 bytes, 0 drops |
Total number and size (in bytes) of outgoing packets of the interface and the number of dropped packets (displayed when the interface supports traffic statistics collection). |
# Display brief information about all loopback interfaces.
<Sysname> display interface loopback brief
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
Loop1 UP UP(s) -- forLAN1
# Display information about all loopback interfaces in down state and the causes.
<Sysname> display interface loopback brief down
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Interface Link Cause
Loop1 ADM Administratively
Field |
Description |
Link |
Physical link state of the interface: · UP—The interface is physically up. · DOWN—The interface is physically down. · ADM—The interface has been shut down by using the shutdown command. To restore the physical state of the interface, use the undo shutdown command. · Stby—The interface is a backup interface in standby state. |
Protocol |
Data link layer protocol state of the interface, which is always UP(s). UP(s) represents that the data link layer protocol of the interface is up, but the link is an on-demand link or does not exist. The (s) attribute represents the spoofing flag. This value is typical of null interfaces and loopback interfaces. |
Primary IP |
Primary IP address of the interface. |
Description |
Description of the interface. |
Cause |
Cause for the physical link state of the interface to be DOWN. Administratively represents that the interface has been manually shut down by using the shutdown command. To restore the physical state of the interface, use the undo shutdown command. |
Related commands
interface loopback
reset counters interface loopback
display interface null
Use display interface null to display information about the null interface.
Syntax
display interface null [ 0 ] [ brief [ description | down ] ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
0: Specifies Null 0.
brief: Displays brief interface information. If you do not specify this keyword, the command displays detailed interface information.
description: Displays complete interface descriptions. If you do not specify this keyword, the command displays only the first 27 characters of interface descriptions.
down: Displays information about interfaces in down state and the causes. If you do not specify this keyword, the command displays information about interfaces in all states.
Usage guidelines
The device has only one null interface Null 0. If you specify the null keyword, the command displays information about the interface Null 0 regardless of whether you specify the 0 keyword.
Examples
# Display detailed information about Null 0. (In this example, the null interface supports traffic statistics collection.)
<Sysname> display interface null 0
NULL0
Current state: UP
Line protocol state: UP(spoofing)
Description: NULL0 Interface
Bandwidth: 1000000 kbps
Maximum transmission unit: 1500
Internet protocol processing: Disabled
Physical: NULL DEV
Last clearing of counters: Never
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# Display detailed information about Null 0. (In this example, the null interface does not support traffic statistics collection.)
<Sysname> display interface null 0
NULL0
Current state: UP
Line protocol state: UP(spoofing)
Description: NULL0 Interface
Maximum transmit unit: 1500
Internet protocol processing: Disabled
Physical: NULL DEV
Last clearing of counters: Never
# Display brief information about Null 0.
<Sysname> display interface null 0 brief
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
NULL0 UP UP(s) --
For the command output, see Table 3 and Table 4.
Related commands
interface null
reset counters interface null
interface loopback
Use interface loopback to create a loopback interface and enter its view, or enter the view of an existing loopback interface.
Use undo interface loopback to remove a loopback interface.
Syntax
interface loopback interface-number
undo interface loopback interface-number
No loopback interfaces exist.
Views
System view
Predefined user roles
network-admin
Parameters
interface-number: Specifies a loopback interface by its number. The value range for this argument varies by device model.
Usage guidelines
The physical layer state and link layer protocols of a loopback interface are always up unless the loopback interface is manually shut down. You can use a loopback interface to achieve the following purposes:
· Prevent the connection from being affected by the physical state of the interface.
· Improve the reliability of the connection.
For example, you can:
· Configure a loopback interface as the source interface for establishing an FTP connection.
· Use the loopback interface address as the Router ID in BGP.
Examples
# Create Loopback 1.
<Sysname> system-view
[Sysname] interface loopback 1
interface null
Use interface null to enter null interface view.
Syntax
interface null 0
Default
A device has only one null interface (Null 0), which cannot be created or deleted.
Views
System view
Predefined user roles
network-admin
Parameters
0: Specifies Null 0. The null interface number is always 0.
Examples
# Enter Null 0 interface view.
<Sysname> system-view
[Sysname] interface null 0
reset counters interface loopback
Use reset counters interface loopback to clear the statistics on the specified or all loopback interfaces.
Syntax
reset counters interface loopback [ interface-number ]
Views
User view
Predefined user roles
network-admin
Parameters
interface-number: Specifies a loopback interface by its number, which can be the number of any existing loopback interface. If you do not specify the interface-number argument, the command clears the statistics on all loopback interfaces.
Usage guidelines
To determine whether a loopback interface works correctly within a period by collecting the traffic statistics within that period, first use the reset counters interface [ loopback [ interface-number ] ] command to clear the statistics. Then have the interface automatically collect the statistics.
This command is available only if a minimum of one loopback interface has been created.
Examples
# Clear the statistics on Loopback 1.
<Sysname> reset counters interface loopback 1
Related commands
display interface loopback
reset counters interface null
Use reset counters interface null to clear the statistics on the null interface.
Syntax
reset counters interface null [ 0 ]
Views
User view
Predefined user roles
network-admin
Parameters
0: Specifies the number of the null interface, which is always 0.
Usage guidelines
To determine whether the null interface works correctly within a period by collecting the traffic statistics within that period, first use the reset counters interface [ null [ 0 ] ] command to clear the statistics. Then have the interface automatically collect the statistics.
Examples
# Clear the statistics on Null 0.
<Sysname> reset counters interface null 0
Related commands
display interface null
shutdown
Use shutdown to shut down a loopback interface.
Use undo shutdown to bring up a loopback interface.
Syntax
shutdown
undo shutdown
Default
A loopback interface is up.
Views
Loopback interface view
Predefined user roles
network-admin
Usage guidelines
Use the shutdown command with caution, because the command disconnects the connection of the interface and disables the interface from communicating.
Examples
# Shut down Loopback 1.
<Sysname> system-view
[Sysname] interface loopback 1
[Sysname-LoopBack1] shutdown