Requirement: In a LAN, VLAN configuration on a switch can reduce the range of the host communication broadcast domain. When some hosts need to communicate with each other, but the switch does not support layer-3 switching, you can use a vro supporting 802.1Q to achieve VLAN interconnection. this requires creating a sub-interface on the Ethernet port, assigning an IP address as the gateway of the VLAN, and starting 802.1Q.
Networking: The vroee0 port is connected to the uplink trunk port (Port 24th) of the vswitch. the downlink port of the vswitch is divided into three VLANs with several hosts.
The topology is as follows:
1. vro Configuration
[Router]
[Router] inter e0
[Router-Ethernet0] ip add 10.0.0.1 255.255.255.0
[Router-Ethernet0] inter e0.1 // define sub-interface E0.1
[Router-Ethernet0.1] ip add 172.16.1.1 255.255.255.0
[Router-Ethernet0.1] vlan-type dot1q vid 1 // specify that the Ethernet sub-interface belongs to vlan1. this command is applied to the Ethernet sub-interface. Only after this command is configured can the Ethernet sub-interface embed VLAN tags in the Ethernet frame header according to the configured vlan id, the switch interface connected to the network port can correctly process received frames.
[Router-Ethernet0.1] inter e0.2 // define sub-interface E0.2
[Router-Ethernet0.2] ip add 172.16.2.1 255.255.255.0
[Router-Ethernet0.2] vlan-type dot1q vid 2 // specify that the Ethernet sub-interface belongs to VLAN2
[Router-Ethernet0.2] inter e0.3 // define sub-interface E0.3
[Router-Ethernet0.3] ip add 172.16.3.1 255.255.255.0
[Router-Ethernet0.3] vlan-type dot1q vid 3 // specify that the Ethernet sub-interface belongs to VLAN3
[Router-Ethernet0.3] inter e0
[Router-Ethernet0] undo shut
% Interface Ethernet0 is up
[Router-Ethernet0] // connect E0 port to S3026 24th port with network cable
% 19: 46: 32: Interface Ethernet0 changed state to UP
% 19: 46: 32: Line protocol ip on interface Ethernet0, changed state to UP
% 19: 46: 32: Line protocol ip on interface Ethernet0.1, changed state to UP
% 19: 46: 32: Line protocol ip on interface Ethernet0.2, changed state to UP
% 19: 46: 32: Line protocol ip on interface Ethernet0.3, changed state to UP
2. Switch configuration
<Quidway>
<Quidway> sys
Enter system view, return user view with Ctrl + Z.
[Quidway] vlan 1
[Quidway-vlan1] vlan 2
[Quidway-vlan2] port ethernet 0/17 to eth 0/19 eth 0/22 // Add port 17th to port 19 and port 22nd to VLAN2
[Quidway-vlan2] vlan 3
[Quidway-vlan3] port eth 0/21 // Add port 21st to VLAN2
-[Quidway-vlan3] inter e0/24
[Quidway-Ethernet0/24] port link-type trunk // set port 24th to a trunk port
[Quidway-Ethernet0/24] port trunk permit vlan all // allow all VLAN traffic through
Please wait ...................................... ..... done.
[Quidway-Ethernet0/24] dis port trunk // verify TRUNK port configuration
Now, the following trunking ports exist:
Ethernet0/24
[Quidway-Ethernet0/24] dis vlan 2 // verify VLAN2 Configuration
Vlan id: 2
VLAN Type: static
Route Interface: not configured
Description: VLANs 0002
Tagged Ports:
Ethernet0/24
Untagged Ports:
Ethernet0/17 Ethernet0/18 Ethernet0/19 Ethernet0/22
[Quidway-Ethernet0/24] dis vlan 3 // verify VLAN3 Configuration
Vlan id: 3
VLAN Type: static
Route Interface: not configured
Description: VLANs 0003
Tagged Ports:
Ethernet0/24
Untagged Ports:
Ethernet0/21
3. Check whether the network is connected on the workstation. This workstation connects to port S3026 21st, which belongs to vlan2.
C: \ Documents ents and Settings \ Administrator> ipconfig
Windows 2000 IP Configuration
Ethernet adapter local connection:
Connection-specific DNS Suffix .:
IP Address ......: 172.16.2.22
Subnet Mask ......: 255.255.255.0
Default Gateway ......: 172.16.2.1
C: \ Documents ents and Settings \ Administrator> ping 172.16.3.1
Pinging 172.16.3.1 with 32 bytes of data:
Reply from 172.16.3.1: bytes = 32 time <10 ms TTL = 255
Reply from 172.16.3.1: bytes = 32 time <10 ms TTL = 255
Reply from 172.16.3.1: bytes = 32 time <10 ms TTL = 255
Reply from 172.16.3.1: bytes = 32 time <10 ms TTL = 255
Ping statistics for 172.16.3.1:
Packets: Sent = 4, stored ED = 4, Lost = 0 (0% loss ),
Approximate round trip times in milli-seconds:
Minimum = 0 ms, Maximum = 0 ms, Average = 0 ms
4. view the route table on the vro. It can be found that because 172.16 of each network segment is a direct connection route, you do not need to enable the routing protocol or Static Routing to achieve communication between VLANs.
[Router] display ip routing-table
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
10.0.0.0/24 Direct 0 0 10.0.0.1 Ethernet0
10.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
172.16.1.0/24 Direct 0 0 172.16.1.1 Ethernet0.1
172.16.1.1/32 Direct 0 0 127.0.0.1 LoopBack0
172.16.2.0/24 Direct 0 0 172.16.2.1 Ethernet0.2
172.16.2.1/32 Direct 0 0 127.0.0.1 LoopBack0
172.16.3.0/24 Direct 0 0 172.16.3.1 Ethernet0.3
172.16.3.1/32 Direct 0 0 127.0.0.1 LoopBack0