Configuring VLANIF Interfaces for Inter-VLAN Communication
Context
After VLANs are configured, users in the same VLAN can communicate with each other while users in different VLANs cannot. To implement inter-VLAN communication, configure VLANIF interfaces which are Layer 3 logical interfaces.
If a VLAN goes Down because all ports in the VLAN go Down, the system immediately reports the VLAN Down event to the corresponding VLANIF interface, instructing the VLANIF interface to go Down. To prevent network flapping caused by changes of VLANIF interface status, enable VLAN damping on the VLANIF interface. After the last Up port in a VLAN goes Down, the system starts a delay timer and informs the corresponding VLANIF interface of the VLAN Down event after the timer expires. If a port in the VLAN goes Up during the delay period, the VLANIF interface remains Up.
If a new VLANIF interface does not need to be enabled immediately (the new VLANIF interface may affect services on the live network), run the set shutdown default vlanif command to shut down the VLANIF interface. Then the VLANIF interfaces that are created subsequently are disabled by default, and the system generates the shutdown command configuration for them. To enable the configured VLANIF interface, run the undo shutdown command to manually enable it.
MTU is short for maximum transmission unit. An MTU value determines the maximum number of bytes each time a sender can send. If the size of packets exceeds the MTU supported by a transit node or a receiver, the transit node or receiver fragments the packets or even discards them, aggravating the network transmission load. To avoid this problem, set the MTU value of the VLANIF interface.
After configuring bandwidth for VLANIF interfaces, you can use the NMS to query the bandwidth. This facilitates traffic monitoring.
To implement communication between VLANs, hosts in each VLAN must use the IP address of the corresponding VLANIF interface as the gateway address.
Procedure
- Run system-view
The system view is displayed.
- (Optional) Run set shutdown default vlanif
New VLANIF interfaces are configured in shutdown state.
By default, a new VLANIF interface is enabled.
- Run interface vlanif vlan-id
A VLANIF interface is created and the VLANIF interface view is displayed.
The VLAN ID specified in this command must be the ID of an existing VLAN.
A VLANIF interface is Up only when at least one physical port added to the corresponding VLAN is Up.
- Run ip address ip-address { mask | mask-length } [ sub ]
An IP address is assigned to the VLANIF interface for communication at the network layer.
If IP addresses assigned to VLANIF interfaces belong to different network segments, a routing protocol must be configured on the device to provide reachable routes. Otherwise, VLANIF interfaces cannot communicate with each other at the network layer.
- (Optional) Run damping time delay-time
The delay period of VLAN damping is configured.
The delay-time value ranges from 0 to 20, in seconds. By default, the delay is 0 seconds, indicating that VLAN damping is disabled.
- (Optional) Run mtu mtu
The MTU value of the VLANIF interface is configured.
By default, the value is 1500.
- The MTU refers to the maximum length of the Layer 3 IP header and subsequent data frames, excluding the Layer 2 frame header.
The mtu value plus the Layer 2 frame header of a VLANIF interface must be smaller than the jumboframe value of the peer interface; otherwise, some packets may be discarded.
- (Optional) Run bandwidth bandwidth
The bandwidth of the VLANIF interface is configured.
By default, the bandwidth of a VLANIF interface is 1000 Mbit/s.
- Run commit
The configuration is committed.