Configuring VLAN interfaces

Hosts of different VLANs use VLAN interfaces to communicate at Layer 3. VLAN interfaces are virtual interfaces that do not exist as physical entities on devices. For each VLAN, you can create one VLAN interface and assign an IP address to it. The VLAN interface acts as the gateway of the VLAN to forward packets destined for another IP subnet at Layer 3.

Before you create a VLAN interface for a VLAN, create the VLAN first.

To configure basic settings of a VLAN interface:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Create a VLAN interface and enter its view.

interface vlan-interface interface-number

If the VLAN interface already exists, you enter its view directly.

By default, no VLAN interfaces exist.

3. Assign an IP address to the VLAN interface.

ip address ip-address { mask | mask-length } [ sub ]

By default, no IP address is assigned to a VLAN interface.

4. Set the description for the VLAN interface.

description text

The default setting is the VLAN interface name. For example, Vlan-interface1 Interface.

5. (Optional.) Specify a primary traffic processing slot for the VLAN interface.

  • In standalone mode:service slot slot-number

  • In IRF mode:service chassis chassis-number slot slot-number

By default, no primary traffic processing slot is specified for an interface.

6. (Optional.) Specify a backup traffic processing slot for the VLAN interface.

  • In standalone mode:service standby slot slot-number

  • In IRF mode:service standby chassis chassis-number slot slot-number

By default, no backup traffic processing slot is specified for an interface.

7. Set the MTU for the VLAN interface.

mtu size

The default MTU of a VLAN interface is 1500 bytes.

8. Set the expected bandwidth for the interface.

bandwidth bandwidth-value

By default, the expected bandwidth (in kbps) is the interface baud rate divided by 1000.

9. (Optional.) Restore the default settings for the VLAN interface.

default

N/A

10. (Optional.) Bring up the VLAN interface.

undo shutdown

The default state of a VLAN interface is up.