- Table of Contents
-
- 03-Layer 2 Command Reference
- 00-Preface
- 01-Ethernet Interface Commands
- 02-Loopback and Null Interface Commands
- 03-VLAN Commands
- 04-MAC Address Table Commands
- 05-Ethernet Link Aggregation Commands
- 06-Spanning Tree Commands
- 07-Layer 2 Forwarding Commands
- 08-PPPoE Commands
- 09-FPGA Fast Forwarding Commands
- 10-QinQ Termination Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
02-Loopback and Null Interface Commands | 58.42 KB |
Loopback and null interface configuration commands
default
Use default to restore the default settings for the loopback or null interface.
Syntax
default
Views
Loopback interface view, null interface view
Default command level
2: System level
Usage guidelines
|
CAUTION: The default command might interrupt ongoing network services. Make sure you are fully aware of the impacts of this command when you use it in 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 individually restore their default settings. If your restoration attempt still fails, follow the error message instructions to resolve the problem.
Examples
# Restore the default settings of interface loopback 0.
<Sysname> system-view
[Sysname] interface loopback 0
[Sysname-loopback0] default
This command will restore the default settings. Continue? [Y/N]:y
description
Use description to change the text description for the current interface.
Use undo description to restore the default description.
Syntax
description text
undo description
Default
The description of a loopback or null interface is interface name Interface, for example, Loopback0 interface.
Views
Loopback interface view, null interface view
Default command level
2: System level
Parameters
text: Specifies an interface description, a case-sensitive string of 1 to 80 characters.
When you specify an interface description, follow these guidelines:
· An interface description can be a mixture of English characters and other Unicode characters. The mixed description cannot exceed the specified string length.
· To use Unicode characters or symbols in an interface description, install the corresponding IME and log in to the device through remote login software that supports the character type.
· Each non-English Unicode character or symbol (non-English characters) takes the space of two regular characters. When the length of a description string reaches or exceeds the maximum line width on the terminal software, the software starts a new line. This might break a Unicode character into two parts and create garbled characters at the end of a line.
Examples
# Set the description for interface loopback 0 to loopback0.
<Sysname> system-view
[Sysname] interface loopback 0
[Sysname-loopback0] description loopback0
display interface
display interface loopback
Use display interface loopback to display information about a loopback interface.
Syntax
display interface [ loopback ] [ brief [ down ] ] [ | { begin | exclude | include } regular-expression ]
display interface loopback interface-number [ brief ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
interface-number: Specifies a loopback interface by its number. The loopback interface number is always 0.
brief: Displays brief interface information. If you do not specify this keyword, the command displays detailed interface information.
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.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Usage guidelines
If you do not specify the loopback keyword, this command displays information about all interfaces on the device.
Examples
# Display detailed information about interface loopback 0.
<Sysname> display interface loopback 0
LoopBack0 current state: UP
Line protocol current state: UP (spoofing)
Description: LoopBack0 Interface
The Maximum Transmit Unit is 1536
Internet protocol processing : disabled
Physical is Loopback
Last clearing of counters: Never
Last 300 seconds input: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output: 0 bytes/sec, 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 drops
0 packets output, 0 bytes, 0 drops
# Display brief information about interface loopback 0.
<Sysname> display interface loopback 0 brief
The brief information of interface(s) under route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Main IP Description
Loop0 UP UP(s) --
# Display brief information about all loopback interfaces in DOWN state.
<Sysname> display interface loopback brief down
The brief information of interface(s) under route mode:
Link: ADM - administratively down; Stby - standby
Interface Link Cause
Loop0 ADM Administratively
Field |
Description |
current state |
Physical layer state of the interface: · Up—The physical layer state of the interface is up. · DOWN (Administratively)—The interface has been shut down manually. |
Line protocol current state |
Data link layer protocol state of the interface, which is always (UP) spoofing. (UP) spoofing means that the data link layer protocol state of the interface is UP, but the corresponding link might not exist, or the corresponding link is non-permanent and established on demand. |
Description |
Description of the interface. |
The Maximum Transmit Unit |
MTU of the interface. |
Internet protocol processing |
State (enabled or disabled) of the network layer protocol (displayed as Internet Address is X.X.X.X/XX Primary). |
Physical is loopback |
The physical type of the interface is loopback. |
Last clearing of counters |
Last time when statistics on the logical interface were cleared by using the reset counters interface command. If the statistics have never been cleared since the device started, this field displays Never. |
Last 300 seconds input: 0 bytes/sec, 0 bits/sec, 0 packets/sec |
Average input rate over the last 300 seconds in Bps, bps, and pps. |
Last 300 seconds output: 0 bytes/sec, 0 bits/sec, 0 packets/sec |
Average output rate over the last 300 seconds in Bps, bps, and pps. |
0 packets input, 0 bytes, 0 drops |
Total number and size (in bytes) of input packets on the interface and the number of dropped packets. |
0 packets output, 0 bytes, 0 drops |
Total number and size (in bytes) of output packets on the interface and the number of dropped packets. |
The brief information of interface(s) under route mode |
Brief information about Layer 3 interfaces. |
Link: ADM - administratively down; Stby - standby |
Explains the Link field values: · ADM—Represents administratively down. The interface has been administratively shut down. To recover its physical state, use the undo shutdown command. · Stby—Represents standby. The interface is operating as a backup interface. To see the primary interface, use the display standby state command in High Availability Command Reference. |
Protocol: (s) - spoofing |
Explains the Protocol field value. (s)—Represents spoofing. If the data link layer protocol of an interface is up but its link is an on-demand link or not present at all, the Protocol field displays UP(s). This attribute is typical of interface Null 0, Inloopback 0, and loopback interfaces. |
Interface |
Abbreviated interface name. |
Link |
Physical layer state of the interface: · UP—The interface is up. · ADM—The interface has been administratively shut down. To recover its physical state, use the undo shutdown command. |
Protocol |
Data link layer protocol state of the interface, which is always UP(s). |
Main IP |
Main IP address of the interface. |
Description |
Description of the interface. |
Cause |
Cause of a down physical link. If the port has been shut down with the shutdown command, this field displays Administratively. To restore the physical state of the interface, use the undo shutdown command. |
interface loopback
display interface null
Use display interface null to display information about the null interface. Because Null 0 interface is the only null interface on a device, this command displays information about Null 0 interface even if you do not specify the 0 keyword.
Syntax
display interface [ null ] [ brief [ down ] ] [ | { begin | exclude | include } regular-expression ]
display interface null 0 [ brief ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
0: Specifies interface Null 0. The null interface number is always 0, because the device has only one null interface.
brief: Displays brief interface information. If you do not specify this keyword, this command displays detailed interface information.
down: Displays information about interfaces in down state and the causes. If you do not specify this keyword, this command displays information about interfaces in all states.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Usage guidelines
If you do not specify the null keyword, this command displays information about all interfaces on the device.
If you specify the null keyword, this command displays information about interface Null 0 with or without the 0 keyword, because the device supports only one null interface.
Examples
# Display detailed information about null interface Null 0.
<Sysname> display interface null 0
NULL0 current state :UP
Line protocol current state :UP (spoofing)
Description : NULL0 Interface
The Maximum Transmit Unit is 1500
Internet protocol processing : disabled
Physical is NULL DEV
Last clearing of counters: Never
Last 300 seconds input: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output: 0 bytes/sec, 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 drops
0 packets output, 0 bytes, 0 drops
# Display brief information about interface Null 0.
<Sysname> display interface null 0 brief
The brief information of interface(s) under route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Main IP Description
NULL0 UP UP(s) --
See Table 1 for the display interface null command output.
interface null
interface loopback
Use interface loopback to create a loopback interface or enter loopback interface view.
Use undo interface loopback to remove a loopback interface.
Syntax
interface loopback interface-number
undo interface loopback interface-number
Views
System view
Default command level
2: System level
Parameters
Examples
# Create interface loopback 0.
<Sysname> system-view
[Sysname] interface loopback 0
[Sysname-LoopBack0]
display interface loopback
interface null
Use interface null to enter null interface view.
Syntax
interface null 0
Views
System view
Default command level
2: System level
Parameters
0: Specifies interface Null 0. The null interface number is always 0.
Usage guidelines
A device has only one null interface, which is always named Null 0 and always up. You cannot remove it or shut it down.
Examples
# Enter Null 0 interface view.
<Sysname> system-view
[Sysname] interface null 0
[Sysname-NULL0]
display interface null
reset counters interface loopback
Use reset counters interface loopback to clear statistics for a loopback interface.
Syntax
reset counters interface [ loopback [ interface-number ] ]
Views
User view
Default command level
2: System level
Parameters
interface-number: Specifies a loopback interface by its number. The loopback interface number is always 0.
Usage guidelines
Clear the existing statistics on the interface before starting to collect new traffic statistics.
If you do not specify the loopback keyword, this command clears the statistics on all interfaces in the system.
If you specify the loopback keyword without the interface-number argument, this command clears the statistics on all loopback interfaces.
Examples
# Clear statistics on loopback interface Loopback 0.
<Sysname> reset counters interface loopback 0
reset counters interface null
Use reset counters interface null to clear statistics on the null interface.
Syntax
reset counters interface [ null [ 0 ] ]
Views
User view
Default command level
2: System level
Parameters
0: Specifies a null interface by its number, which is always 0.
Usage guidelines
Clear the existing statistics on the interface before starting to collect new traffic statistics.
If you do not specify the null keyword, this command clears statistics on all interfaces.
If you specify the null keyword, this command clears the statistics on interface Null 0 with or without the 0 keyword, because the device supports only one interface Null 0.
Examples
# Clear statistics for interface Null 0.
<Sysname> reset counters interface null 0
shutdown
Use shutdown to shut down the current loopback interface.
Use undo shutdown to bring up the current loopback interface.
Syntax
shutdown
undo shutdown
Default
A loopback interface is up.
Views
Loopback interface view
Default command level
2: System level
Examples
# Shut down loopback interface loopback 0.
<Sysname> system-view
[Sysname] interface loopback 0