Default command level
2: System level
Parameters
ip-address: Specifies an IP address in dotted decimal notation.
mask: Specifies a subnet mask in dotted decimal notation.
mask-length: Sets the number of consecutive 1s in the subnet mask, in the range of 0 to 32.
sub: Indicates the address is a secondary IP address.
Usage guidelines
To connect a VLAN to multiple subnets, assign one primary IP address and one secondary IP addresses
to a VLAN interface.
When you configure IP addresses for a VLAN interface, follow these restrictions and guidelines:
You can assign a primary IP address to a VLAN interface multiple times. The most recent
•
configuration takes effect.
Remove all secondary IP addresses before you remove the primary IP address.
•
To remove all IP addresses, use the undo ip address command without any parameters.
•
•
To remove the primary IP address, use the undo ip address ip-address { mask | mask-length }
command.
To remove a secondary IP address, use the undo ip address ip-address { mask | mask-length } sub
•
command.
Examples
# Specify the IP address as 1.1.0.1 and the subnet mask as 255.255.255.0 for VLAN-interface 1.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] ip address 1.1.0.1 255.255.255.0
Related commands
display ip interface (Layer 3 Command Reference)
mtu
Use mtu to set the MTU for a VLAN interface.
Use undo mtu to restore the default.
Syntax
mtu size
undo mtu
Default
The MTU of a VLAN interface is 1500 bytes.
Views
VLAN interface view
40