Huawei ENSP configures inter-VLAN routing


Inter-VLAN routing: Routing through Layer 3 devices allows different VLANs to communicate with each other. But only unicast communication is allowed. Broadcast frames between different VLANs are still isolated, without losing the original meaning of VLANs.
There are two methods for routing between VLANs: Switch Virtual Interface (SVI) of multilayer switches and one-arm routing of routers.

When changing the interface properties of the switch, such as access------>>trunk or trunk------>>access, the default configuration of the interface must be reset.
[SW1]interface gi0/0/1
[SW1-GigabitEthernet0/0/1]undo port link-type access #Cancel accesss is invalid
Error: Too many parameters found at'^' position.
[SW1]clear configuration interface gi0/0/ 1 #Reset port
[SW1]interface gi0/0/1
[SW1-GigabitEthernet0/0/1]dis this

interface GigabitEthernet0/0/1
shutdown

return
[SW1-GigabitEthernet0/0/1]undo shutdown #Enable port

1. Multilayer switch exchange virtual interface SVI configuration

Configure the VLAN interface through the access layer switch, and configure the trunk link on the core layer switch to realize the mutual communication of different VLANs or external network communication.
Inter-VLAN routing SCI topology

(1) Assign the interface to VLAN configuration

1. Create VLAN 10 and VLAN 20 to configure SW1

system-view #Enter system view
[Huawei]undo info-center enable #Close the message center
Info: Information center is disabled.
[Huawei]sysname SW1 #Rename the switch to SW1
[SW1]vlan 10
#Create VLAN 10 [SW1- vlan10]quit
[SW1]vlan 20 #Create VLAN 20
[SW1-vlan20]quit

[SW1]vlan batch 10 20 #Or you can create VLAN10 and VLAN20 at the same time
[SW1]vlan batch 30 to 40 #Create multiple VLANs in batches, VLAN30 to VLAN 40, Cisco does not have this command

[SW1]interface gi0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access #The type of interface is configured as access, dedicated to the PC host
[SW1-GigabitEthernet0/0/1]port default vlan 10 #will The interface gi0/0/1 is allocated to VLAN10.

[SW1]interface gi0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 10 #divide interface gi0/0/2 into VLAN10

[SW1]interface gi0/0/3
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/3]port default vlan 20 #divide interface gi0/0/3 into VLAN 20

2. In the same way, create VLAN 10 and VLAN 20 to configure SW1

(2) Configure the trunk of the core switch SW3

1. Configure the two interfaces of the core switch as trunk

[SW3]vlan batch 10 20
[SW3-GigabitEthernet0/0/1]port link-type trunk #配置接口为trunk
[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW3-GigabitEthernet0/0/2]port link-type trunk
[SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan all

2. Configure the virtual interface gateway address

[SW3]interface vlan 10
[SW3-Vlanif10]ip add 192.168.1.254 24
[SW3-Vlanif10]quit
[SW3]int vlan 20
[SW3-Vlanif20]ip add 192.168.20.254 24
[SW3-Vlanif20]quit
display ip interface brief
Display interface

3. Configure the trunk link of the two switches

[SW1]interface gi0/0/4
[SW1-GigabitEthernet0/0/4]port link-type trunk
[SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/4]undo shutdown
Info: Interface GigabitEthernet0/0/4 is not shutdown.
[SW1-GigabitEthernet0/0/4]dis this

interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094

return

[SW2]interface gi0/0/1
[SW2-GigabitEthernet0/0/1]port link-type trunk
[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW2-GigabitEthernet0/0/1]dis this

interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094

return

(3) Unicom test

Unicom test

Two, single-arm routing

Single-arm routing is to create and simulate multiple sub-interface binding to transmit VLAN transmission data through a trunk trunk line, saving the cost of connection lines.
One-arm routing topology

(1) Create and configure VLAN 10 and VLAN 20 of SW1

system-view #Enter the system view
[Huawei]sysname SW1 #Rename the switch to SW1
[SW1]undo info-center enable #Close the message center
[SW1]vlan batch 10 20 #Create VLAN10 and VLAN20 in batches

1. Divide the interface gi0/0/1 into VLAN10

[SW1]interface gi0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access #The type of interface is configured as access, dedicated to the PC host
[SW1-GigabitEthernet0/0/1]port default vlan 10 #will The interface gi0/0/1 is allocated to VLAN10.
[SW1-GigabitEthernet0/0/1]dis this

interface GigabitEthernet0/0/1
port link-type access
port default vlan 10

return

2. Divide the interface gi0/0/2 into VLAN20

[SW1]interface gi0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1-GigabitEthernet0/0/2]dis this

interface GigabitEthernet0/0/2
port link-type access
port default vlan 20

return

(2) Configure the link between the switch and the router as a Trunk link.

[SW1]interface gi0/0/3
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/3]dis this

interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094

return

(3) Create sub-interfaces on the router to support VLAN routing

[R1]interface e0/0/0.10 #Enter the logical sub-interface
[R1-Ethernet0/0/0.10]ip add 192.168.10.1 24 #Configure the IP address
[R1-Ethernet0/0/0.10]dot1q termination vid 10 #Specify to VLAN10 Binding
[R1-Ethernet0/0/0.10]arp broadcast enable #Open arp broadcast forwarding data
[R1-Ethernet0/0/0.10] display this

interface Ethernet0/0/0.10
dot1q termination vid 10
ip address 192.168.10.1 255.255.255.0
arp broadcast enable

return
display ip interface brief
View virtual interface
Unicom inspection

Guess you like

Origin blog.csdn.net/qq_27383609/article/details/112852615