- Table of Contents
-
- 04-Layer 3 Command Reference
- 00-Preface
- 01-ARP Commands
- 02-IP Addressing Commands
- 03-DHCP Commands
- 04-DHCPv6 Commands
- 05-DNS Commands
- 06-IPv6 DNS Commands
- 07-NAT Commands
- 08-Adjacency Table Commands
- 09-Flow Classification Commands
- 10-IPv6 Basics Commands
- 11-IP Performance Optimization Commands
- 12-Basic IP Routing Commands
- 13-Static Routing Commands
- 14-IPv6 Static Routing Commands
- 15-GRE Commands
- 16-RIP Commands
- 17-RIPng Commands
- 18-Policy-Based Routing Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
02-IP Addressing Commands | 68.58 KB |
IP addressing configuration commands
display ip interface
Use display ip interface to display IP configuration information about a specific Layer 3 interface or all Layer 3 interfaces.
Syntax
display ip interface [ interface-type interface-number ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
interface-type interface-number: Specifies an interface by its type and number.
|: 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.
Examples
# Display IP configuration information about interface VLAN-interface 1.
<Sysname> display ip interface vlan-interface 1
Vlan-interface1 current state :DOWN
Line protocol current state :DOWN
Internet Address is 1.1.1.1/8 Primary
Broadcast address : 1.255.255.255
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
ARP packet input number: 0
Request packet: 0
Reply packet: 0
Unknown packet: 0
TTL invalid packet number: 0
ICMP packet input number: 0
Echo reply: 0
Unreachable: 0
Source quench: 0
Routing redirect: 0
Echo request: 0
Router advert: 0
Router solicit: 0
Time exceed: 0
IP header bad: 0
Timestamp request: 0
Timestamp reply: 0
Information request: 0
Information reply: 0
Netmask request: 0
Netmask reply: 0
Unknown type: 0
Table 1 Command output
Field |
Description |
current state |
Current physical state of the interface: · Administrative DOWN—The interface is shut down with the shutdown command. · DOWN—The interface is administratively up but its physical state is down, which may be caused by a connection or link failure. · UP—Both the administrative and physical states of the interface are up. |
Line protocol current state |
Current state of the link layer protocol: · DOWN—The protocol state of the interface is down. · UP—The protocol state of the interface is up. · UP (spoofing)—The link protocol state of the interface is up, but the link is temporarily set up on demand or does not exist. |
Internet Address |
IP address of an interface followed by: · Primary—A primary IP address. · Sub—A secondary IP address. · negotiated—A PPP negotiated IP address. · unnumbered—An unnumbered IP address. · acquired via DHCP—An IP address obtained through DHCP. · acquired via BOOTP—An IP address obtained through BOOTP. · Cluster—A cluster IP address. · Mad—A MAD IP address. |
Broadcast address |
Broadcast address of the subnet attached to an interface. |
The Maximum Transmit Unit |
Maximum transmission units (in bytes) on the interface. |
input packets, bytes, multicasts output packets, bytes, multicasts |
Unicast packets, bytes, and multicast packets received on an interface (statistics start at device startup). |
ARP packet input number: Request packet: Reply packet: Unknown packet: |
Total number of ARP packets received on the interface (statistics start at device startup): · ARP request packets. · ARP reply packets. · Unknown packets. |
TTL invalid packet number |
Number of TTL-invalid packets received on the interface (statistics start at device startup). |
ICMP packet input number: Echo reply: Unreachable: Source quench: Routing redirect: Echo request: Router advert: Router solicit: Time exceed: IP header bad: Timestamp request: Timestamp reply: Information request: Information reply: Netmask request: Netmask reply: Unknown type: |
Total number of ICMP packets received on the interface (statistics start at device startup): · Echo reply packets. · Unreachable packets. · Source quench packets. · Routing redirect packets. · Echo request packets. · Router advertisement packets. · Router solicitation packets. · Time exceeded packets. · IP header bad packets. · Timestamp request packets. · Timestamp reply packets. · Information request packets. · Information reply packets. · Netmask request packets. · Netmask reply packets. · Unknown type packets. |
display ip interface brief
Use display ip interface brief to display brief IP configuration information about a specific Layer 3 interface or all Layer 3 interfaces.
Syntax
display ip interface [ interface-type [ interface-number ] ] brief [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
interface-type: Specifies the interface type.
interface-number: Specifies the interface number.
|: 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 interface type or interface number, this command displays brief IP configuration information about all Layer 3 interfaces.
If you specify only the interface type, this command displays brief IP configuration information about all Layer 3 interfaces of the specified type.
If you specify both the interface type and interface number, this command displays only brief IP configuration information about the specified interface.
Examples
# Display brief IP configuration information about VLAN interfaces.
<Sysname> display ip interface vlan-interface brief
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP Address Description
Vlan1 up up 6.6.6.6 --
Vlan2 up up 7.7.7.7 VLAN2
Table 2 Command output
Field |
Description |
*down: administratively down |
The interface is administratively shut down with the shutdown command. |
(s) : spoofing |
Spoofing attribute of the interface. It indicates that an interface may have no link present even when its link layer protocol is displayed up or the link is set up only on demand. |
(l) : loopback |
Link loopback test supported by PPP and HDLC. |
Interface |
Interface name. |
Physical |
Physical state of the interface: · *down—The interface is administratively down. That is, the interface is shut down with the shutdown command. · down—The interface is administratively up but its physical state is down. · up—Both the administrative and physical states of the interface are up. |
Protocol |
Link layer protocol state of the interface: · down—The protocol state of the interface is down. · up—The protocol state of the interface is up. · up(s)—The protocol state of the interface is up (spoofing). · up(l)—The protocol state of the interface is up (loopback). · down(l)—The protocol state of the interface is down (loopback). |
IP Address |
IP address of the interface. If no IP address is configured, two hyphens (--) are displayed. |
Description |
Interface description information. If no IP address is configured, two hyphens (--) are displayed. At most, 27 characters can be displayed. If there are more than 27 characters, only the first 24 characters and three dots (…) are displayed. |
Related commands
display ip interface
ip address
Use ip address to assign an IP address and mask to the interface.
Use undo ip address to remove all IP addresses from the interface.
Use undo ip address ip-address { mask | mask-length } to remove the primary IP address.
Use undo ip address ip-address { mask | mask-length } sub to remove a secondary IP address.
Syntax
ip address ip-address { mask-length | mask } [ sub ]
undo ip address [ ip-address { mask-length | mask } [ sub ] ]
Default
No IP address is assigned to any interface.
Views
Interface view
Default command level
2: System level
Parameters
ip-address: Specifies the IP address of interface, in dotted decimal notation.
mask-length: Specifies the subnet mask length, the number of consecutive ones in the mask.
mask: Specifies the subnet mask in dotted decimal notation.
sub: Specifies the secondary IP address for the interface.
Usage guidelines
When assigning IP addresses to an interface, follow these guidelines:
· You can assign only one primary IP address to an interface.
· The primary and secondary IP addresses can be located in the same network segment.
· Before removing the primary IP address, remove all secondary IP addresses.
· You cannot assign a secondary IP address to the interface that is configured to borrow an IP address through IP unnumbered or obtain one through BOOTP, DHCP, or PPP negotiation.
Examples
# Assign VLAN-interface 1 a primary IP address 129.12.0.1 and a secondary IP address 202.38.160.1 with subnet masks being 255.255.255.0.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] ip address 129.12.0.1 255.255.255.0
[Sysname-Vlan-interface1] ip address 202.38.160.1 255.255.255.0 sub
Related commands
display ip interface