- Table of Contents
-
- 05-Layer 3—IP Services Command Reference
- 00-Preface
- 01-ARP commands
- 02-IP addressing commands
- 03-DNS commands
- 04-IP forwarding basics commands
- 05-Fast forwarding commands
- 06-Adjacency table commands
- 07-IRDP commands
- 08-IP performance optimization commands
- 09-UDP helper commands
- 10-IPv6 basics commands
- 11-IPv6 fast forwarding commands
- 12-Tunneling commands
- 13-GRE commands
- 14-HTTP redirect commands
- 15-ADVPN commands
- Related Documents
-
Title | Size | Download |
---|---|---|
02-IP addressing commands | 90.25 KB |
IP addressing commands
display ip interface
Use display ip interface to display IP configuration and statistics for Layer 3 interfaces.
Syntax
display ip interface [ interface-type [ interface-number ] ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
interface-type: Specifies an interface by its type.
interface-number: Specifies an interface by its number.
Usage guidelines
Use the display ip interface command to display IP configuration and statistics for the specified Layer 3 interface. The statistics include the following information:
· The number of unicast packets, bytes, and multicast packets the interface has sent and received.
· The number of TTL-invalid packets and ICMP packets the interface has received.
The packet statistics helps you locate a possible attack on the network.
If you want the input packets and output packets fields to reflect the accurate statistics for an interface, configure the statistics l3-packet enable command on the interface. Since then, the device collects incoming and outgoing IP packets for the interface. Such statistics counting might cause high CPU usage and degrade the device performance. If the statistics are not necessary, to ensure the device performance, do not configure the statistics l3-packet enable command.
If you specify only the interface type, this command displays IP configuration and statistics for all interfaces of this interface type. If you do not specify any optional parameters, this command displays IP configuration and statistics for all Layer 3 interfaces except VA interfaces and remote interfaces.
Examples
# Display IP configuration and statistics for Ten-GigabitEthernet 3/0/1.
<Sysname> display ip interface ten-gigabitethernet 3/0/1
Ten-GigabitEthernet3/0/1 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
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 |
Physical link state of the interface: · Administrative DOWN—The interface has been shut down by using the shutdown command. · DOWN—The interface is administratively up, but its physical state is down (possibly because no physical link exists or the link has failed). · UP—The interface is both administratively and physically up. |
Line protocol current state |
Data link layer state of the interface. · DOWN—The data link layer protocol is down. · UP—The data link layer protocol is up. · UP (spoofing)—The data link layer protocol is up, but the link is an on-demand link or does not exist. |
Internet Address |
IP address of an interface followed by: · Primary—A primary IP address. · Sub—A secondary IP address. · MTunnel—An MTunnel interface IP address. · PPP-Negotiated—A PPP negotiated IP address. · Unnumbered—An unnumbered IP address. · DHCP-Allocated—An IP address obtained through DHCP. · BOOTP-Allocated—An IP address obtained through BOOTP. · Mad—A MAD IP address. |
Broadcast address |
Broadcast address of the subnet attached to an interface. |
The Maximum Transmit Unit |
MTU of the interface, in bytes. |
input packets, bytes, multicasts output packets, bytes, multicasts |
All received and sent packets and bytes, and received and sent multicast packets on an interface (statistics start at the device startup). |
TTL invalid packet number |
Number of TTL-invalid packets received on the interface (statistics start at the 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 the 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. |
Related commands
display ip interface brief
ip address
statistics l3-packet enable
display ip interface brief
Use display ip interface brief to display brief IP configuration for Layer 3 interfaces.
Syntax
display ip interface [ interface-type [ interface-number ] ] brief [ description ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
interface-type: Specifies an interface type. If you do not specify an interface type, this command displays brief IP configuration for all Layer 3 interfaces except VA interfaces and remote interfaces.
interface-number: Specifies an interface number. If you do not specify an interface number, this command displays brief IP configuration for all Layer 3 interfaces of the specified type.
description: Displays complete interface descriptions. If you do not specify this keyword, the command displays a maximum of 13 characters for each interface description. If the description is longer than 13 characters, the first 10 characters are displayed, followed by an ellipsis (...).
Usage guidelines
Information displayed by the command includes the state of the physical and link layer protocols, IP address, and interface descriptions.
Examples
# Display brief IP configuration for Ten-GigabitEthernet interfaces.
<Sysname> display ip interface ten-gigabitethernet brief
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP Address/Mask VPN instance Description
XGE3/0/1 up up 5.5.5.1/24 -- Link to Co...
XGE3/0/2 up up 6.6.6.1/24 Vpn-first... --
<Sysname> display ip interface gigabitethernet brief description
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP Address/Mask VPN instance Description
XGE3/0/1 up up 5.5.5.1/24 -- Link to CoreR
Outer.
XGE3/0/2 up up 6.6.6.1/24 Vpn-first-in --
Stance
Table 2 Command output
Field |
Description |
*down: administratively down |
The interface is administratively shut down by using the shutdown command. |
(s) : spoofing |
Spoofing attribute of the interface. The link protocol state of the interface is up, but the link is temporarily established on demand or does not exist. |
Interface |
Interface name. |
Physical |
Physical state of the interface: · *down—The interface is administratively shut down by using the shutdown command. · down—The interface is administratively up but its physical state is down, possibly because of a connection or link failure. · 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. · down(l)—The protocol state of the interface is down (loopback). · up—The protocol state of the interface is up. · up(l)—The protocol state of the interface is up (loopback). · up(s)—The protocol state of the interface is up (spoofing). |
IP address/Mask |
IP address and mask of the interface. If no IP address is configured, this field displays hyphens (--). |
VPN instance |
Name of the VPN instance to which the interface belongs. This field can display a maximum of 12 characters. If the VPN instance name is longer than 12 characters, the first 9 characters are displayed, followed by an ellipsis (...). If the interface does not belong to any VPN instance, this field displays hyphens (--). |
Description |
Description of the interface. If no description is configured, this field displays hyphens (--). |
Related commands
display ip interface
ip address
ip address
Use ip address to assign an IP address to the interface.
Use undo ip address to remove the IP address from the interface.
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 an interface.
Views
Interface view
Predefined user roles
network-admin
Parameters
ip-address: Specifies the IP address of the interface, in dotted decimal notation.
mask-length: Specifies the subnet mask length in the range of 1 to 31. For a loopback interface, the value range is 1 to 32.
mask: Specifies the subnet mask in dotted decimal notation.
sub: Assigns a secondary IP address to the interface.
Usage guidelines
Use the command to assign a primary or secondary IP address to an interface.
An interface can have only one primary IP address. If you execute this command multiple times to specify different primary IP addresses on an interface, the most recent configuration takes effect. If the interface connects to multiple subnets, configure primary and secondary IP addresses on the interface so the subnets can communicate with each other through the interface.
You cannot assign secondary IP addresses to an interface that obtains an IP address through BOOTP, DHCP, PPP address negotiation, or IP unnumbered.
If you do not specify any parameters, the undo ip address command removes all IP addresses from the interface. The undo ip address ip-address { mask | mask-length } command removes the primary IP address. The undo ip address ip-address { mask | mask-length } sub command removes a secondary IP address.
The primary and secondary IP addresses assigned to the interface can be located on the same network segment. Different interfaces on your device must reside on different network segments.
Examples
# Assign Ten-GigabitEthernet 3/0/1 a primary IP address 129.102.0.1 and a secondary IP address 202.38.160.1, with the subnet masks both 255.255.255.0.
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 3/0/1
[Sysname-Ten-GigabitEthernet3/0/1] ip address 129.102.0.1 255.255.255.0
[Sysname-Ten-GigabitEthernet3/0/1] ip address 202.38.160.1 255.255.255.0 sub
Related commands
display ip interface
display ip interface brief
ip address te-tunnel unnumbered
Use ip address te-tunnel unnumbered to configure all MPLS TE tunnel interfaces on the device as IP unnumbered to borrow an IP address from an interface.
Use undo ip address te-tunnel unnumbered to restore the default.
Syntax
ip address te-tunnel unnumbered interface interface-type interface-number
undo ip address te-tunnel unnumbered
Default
MPLS TE tunnel interfaces do not borrow IP addresses from any interfaces.
Views
System view
Predefined user roles
network-admin
Parameters
interface interface-type interface-number Specifies an interface from which the MPLS TE tunnel interfaces can borrow an IP address. The interface cannot be an MPLS TE tunnel interface.
Usage guidelines
If the controller deploys multiple MPLS TE tunnel interfaces to the device, specifying IP addresses to these interfaces will be tedious and consume a large number of IP address resources. To resolve the issue, you can configure all MPLS TE tunnel interfaces as IP unnumbered to borrow an IP address from a specific interface.
If you execute this command in system view and configure an MPLS TE tunnel interface to obtain an IP address through manual configuration, DHCP, or IP unnumbered, the interface-specific configuration takes effect.
If you execute the command multiple times, the most recent configuration takes effect.
Examples
# Configure MPLS TE tunnel interfaces on the device to borrow the IP address of the interface Ten-GigabitEthernet3/0/1.
<Sysname> system-view
[Sysname] ip address te-tunnel unnumbered interface ten-gigabitethernet 3/0/1
ip address unnumbered
Use ip address unnumbered to configure the current interface as IP unnumbered to borrow an IP address from the specified interface.
Use undo ip address unnumbered to restore the default.
Syntax
ip address unnumbered interface interface-type interface-number
undo ip address unnumbered
Default
The interface does not borrow IP addresses from other interfaces.
Views
Interface view
Predefined user roles
network-admin
Parameters
interface interface-type interface-number: Specifies an interface from which the current interface can borrow an IP address.
Usage guidelines
Typically, you assign an IP address to an interface either manually or through DHCP. If the IP addresses are not enough, or the interface is used only occasionally, you can configure an interface to borrow an IP address from other interfaces. This is called IP unnumbered, and the interface borrowing the IP address is called IP unnumbered interface.
Loopback interfaces cannot borrow IP addresses of other interfaces, but other interfaces can borrow IP addresses of loopback interfaces.
Multiple interfaces can use the same unnumbered IP address. If an interface has multiple manually configured IP addresses, only the primary IP address manually configured can be borrowed.
You cannot enable a dynamic routing protocol on the interface that has no IP address configured. To enable the interface to communicate with other devices, you must configure a static route to the peer device on the interface.
Tunnel interfaces with the IPv6 over IPv4 tunnel mode do not support this command, and the address of the tunnel interface cannot be borrowed by other interfaces.
Examples
# Configure Tunnel 0 to borrow the IP address of the interface Ten-GigabitEthernet 3/0/1.
<Sysname> system-view
[Sysname] interface tunnel 0 mode gre
[Sysname-Tunnel0] ip address unnumbered interface ten-gigabitethernet 3/0/1