635
ip address
Syntax ip address ip-address { mask | mask-length } [ sub ]
undo ip address [ ip-address { mask | mask-length } [ sub ]]
View VLAN interface view
Parameter ip-address: IP address of a VLAN interface, in dotted decimal format.
mask: Subnet mask that corresponds to the IP address of a VLAN interface, in
dotted decimal format.
mask-length: Length of a sub-net mask, indicated by the number of “1”s, in the
range 0 to 32.
sub: Indicates the address is a sub-IP address of the VLAN interface.
Description Use the ip address command to specify the IP address and subnet mask for a
VLAN interface.
Use the
undo ip address command to remove the IP address and sub-net mask
for a VLAN interface.
By default, no IP address is configured.
An interface normally has one IP address. To enable a device to connect to multiple
subnets, a maximum of 32 IP addresses can be configured on a VLAN interface, in
which one is the primary IP address and all the rest are secondary IP addresses. The
total number of IP addresses on a VLAN interface varies by device. Their
relationship is illustrated as follows:
■ A newly configured main IP address will replace the original one, if there is one.
■ Using the undo ip address command without any parameter indicates that all
IP addresses will be deleted from the VLAN interface.
■ Use the undo ip address ip-address { mask | mask-length } command to
delete the main IP address.
■ Use the undo ip address ip-address { mask | mask-length } sub command to
delete a sub-interface.
■ Note that before deletion of the main IP address you must first delete the
sub-IP address.
Related command: display ip interface on page 781.
Example # Specify the IP address as 1.1.0.1, the sub-net mask as 255.255.255.0 for the
VLAN interface 1.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] ip address 1.1.0.1 255.255.255.0