Configuring Inter-VLAN Communication
After VLANs are assigned, users in the same VLAN can communication with each other while users in different VLANs cannot. If some users in different VLANs need to communicate, configure inter-VLAN communication.
Context
A VLANIF interface is a Layer 3 logical interface that provides inter-VLAN Layer 3 connectivity. VLANIF interfaces are simple to configure and are one of the most commonly used technologies. Each VLAN corresponds to a VLANIF interface. After an IP address is configured for a VLANIF interface, the VLANIF interface is used as the gateway of the VLAN and forwards packets across network segments at Layer 3.
Usually, a VLANIF interface requires only IP address. In some scenarios, you need to configure multiple IP addresses for the VLANIF interface. For example, a switch connects to a physical network through an interface, and hosts on this network belong to multiple network segments (multiple PCs connect to the network through hubs or simplified Layer 2 switches, or one PC uses dual network adapters to connect to the network). To enable the switch to communicate with all hosts on the physical network, configure a primary IP address and multiple secondary IP addresses for this interface.
f a VLAN goes Down because all interfaces in the VLAN went Down, the system immediately reports the VLAN Down event to the corresponding VLANIF interface, instructing the VLANIF interface to go Down. To avoid network flapping from the VLANIF interface status change, enable VLAN damping on the VLANIF interface. With VLAN damping, after the last interface in Up state in a VLAN goes Down, the device starts a delay timer. It will only inform the corresponding VLANIF interface of the VLAN Down event after the timer expires. In this way, if an interface in the VLAN goes Up during the delay, the VLANIF interface remains Up.
The Maximum Transmission Unit (MTU) determines the maximum number of bytes that can be sent at a time. If the size of the packets exceeds the MTU supported by a receiver or a transit node, then the packet will be fragmented or discarded, increasing the network transmission load. To avoid this problem, set the MTU of the VLANIF interface appropriately.
After configuring bandwidth for a VLANIF interface, you can use the NMS to query the bandwidth to facilitate traffic monitoring.
- For details about the Dot1q termination sub-interface, see Using a Dot1q Termination Sub-interface to Implement Inter-VLAN Communication.
- For details about VLAN aggregation, see VLAN Aggregation Configuration.
- For details about VLAN Switch switch-vlan, see Configuring Switch-vlan.
After a VLANIF interface is configured, the corresponding VLAN cannot be configured as a VLAN for Dot1q termination sub-interfaces or an outer VLAN for QinQ termination sub-interfaces.
Pre-configuration Tasks
Before configuring inter-VLAN communication, complete the following tasks:
Perform the task of assign VLANs.
- Configure the default gateway address of hosts as the IP address of the VLANIF interface.
Procedure
- Run:
system-view
The system view is displayed.
- Run:
interface vlanif vlan-id
The VLANIF interface view is displayed.
A VLANIF interface goes Up only when at least one physical interface in the corresponding VLAN is in Up state.
- Run:
ip address ip-address { mask | mask-length } [ sub ]
An IP address is configured for the VLANIF interface to implement Layer 3 connectivity.
If IP addresses assigned to VLANIF interfaces belong to different network segments, you need to configure a routing protocol on the device to provide reachable routes.
Each VLANIF interface can be configured with one primary IP address and 255 secondary IP addresses.
An IP address of a VLANIF interface can be statically configured or dynamically obtained using DHCP. For details about DHCP, see DHCP Configuration in the S12700 V200R010C00 Configuration Guide - IP Services.
- (Optional) Run:
damping time delay-time
The delay of VLAN damping is set.
The 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 of the VLANIF interface is set.
By default, the value is 1500 bytes.
After using the mtu command to change the MTU of an interface, restart the interface to make the new MTU take effect. To restart the interface, run the shutdown command and then the undo shutdown command, or run the restart command in the interface view.
The MTU plus the Layer 2 frame header of a VLANIF interface must be smaller than the maximum frame length of the remote interface by the jumboframe command; otherwise, some frames may be discarded.
- If the MTU is too small whereas the packet size is large, the packet may be split into many fragments. Consequently, the device may discard the packet due to the insufficient QoS queue length. To prevent this problem, run the qos queue length command to increase the QoS queue length.
- (Optional) Run:
bandwidth bandwidth
The bandwidth of the VLANIF interface is set.
Checking the Configuration
Run the display interface vlanif [ vlan-id | main ] command to check the status, configuration, and traffic statistics of the VLANIF interface.
Only a VLANIF interface in Up state can forward packets at Layer 3. When the VLANIF interface goes Down, rectify the fault according to A VLANIF Interface Goes Down.