HP MSR2000/3000/4000 Router Series Layer 3 - IP Services Command Reference

23
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. The value range is from 1 to 31. For a loopback interface,
the value range is from 1 to 32.
mask: Specifies the subnet mask in dotted decimal notation.
sub: Assigns a secondary IP address to the interface.
Usage guidelines
Use this command to configure a primary IP address for an interface. 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.
An interface can have only one primary IP address. A newly configured primary IP address overwrites
the previous address.
You cannot assign secondary IP addresses to an interface that obtains an IP address through BOOTP,
DHCP, PPP address negotiation, or IP unnumbered.
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. Before removing the
primary IP address, remove all secondary IP addresses.
The primary and secondary IP addresses you assign to the interface can be located on the same network
segment, but different interfaces on your device must reside on different network segments.
Examples
# Assign Ethernet 1/1 a primary IP address 129.102.0.1 and a secondary IP address 202.38.160.1, with
the subnet masks both being 255.255.255.0.
<Sysname> system-view
[Sysname] interface ethernet 1/1
[Sysname-Ethernet1/1] ip address 129.102.0.1 255.255.255.0
[Sysname-Ethernet1/1] ip address 202.38.160.1 255.255.255.0 sub
Related commands
display ip interface
display ip interface brief