R0106-HP MSR Router Series Layer 3 - IP Services Command Reference(V7)

23
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 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. Different interfaces on your device must reside on different network segments.
Examples
# Assign GigabitEthernet 2/1/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.