As a leading global ICT solutions provider, Huawei's router and switch products play a key role in building advanced network infrastructures. So how are Huawei's routers and switches connected in a network? Today, Linknewnet engineers teach you 2 ways.
If the switch under the router is a Layer 2 device, there are two ways for you to interface the router with the switch.
1. The interface that the AR router interfaces with the switch is a Layer 3 interface, and since there are multiple vlan's, multiple sub-interfaces need to be configured to terminate the vlan (what is referred to as single-arm routing)
2. The AR router interfaces with the switch are Layer 2 interfaces. the address of the VLANif is created on the router. then it is interoperable.
The first way:
Switch Configuration
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]interface g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 2
[Huawei-GigabitEthernet0/0/2]q
[Huawei]interface g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 3
[Huawei-GigabitEthernet0/0/3]q
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
[Huawei-GigabitEthernet0/0/1]q
AR Router Configuration
<HUAWEI>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]interface G0/0/1.1
[Huawei-GigabitEthernet0/0/1.1]dot1q termination vid 2 vlan2(Configure the subinterface to terminate vlan2)
[Huawei-GigabitEthernet0/0/1.1]IP address 192.168.1.2 24
[Huawei-GigabitEthernet0/0/1.1]ARP broadcast enable (Enable the ARP broadcast function for the subinterface )
[Huawei-GigabitEthernet0/0/1.1]q
[Huawei]interface G0/0/1.2
[Huawei-GigabitEthernet0/0/1.2]dot1q termination vid 3
[Huawei-GigabitEthernet0/0/1.2]IP address 192.168.2.2 24
[Huawei-GigabitEthernet0/0/1.2]ARP broadcast enable
[Huawei-GigabitEthernet0/0/1.2]q
The second way:
The switch is configured in the same way as the first one
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]interface g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 2
[Huawei-GigabitEthernet0/0/2]q
[Huawei]interface g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 3
[Huawei-GigabitEthernet0/0/3]q
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
[Huawei-GigabitEthernet0/0/1]q
AR router configuration:
The Layer 3 port of the AR router, in general, cannot be converted to a Layer 2 port If your router interface cannot be converted to a Layer 2 port or does not have a Layer 2 port, you cannot perform the following configuration; if the Layer 3 port of your AR router can be converted to a Layer 2 port or if it has a Layer 2 port itself, you can perform the following configuration.
[HUAWEI]vlan batch 2 3
[HUAWEI]interface eth0/0/1
[HUAWEI-GigabitEthernet0/0/1]port link-type trunk
[HUAWEI-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
[HUAWEI-GigabitEthernet0/0/1]q
[HUAWEI]interface Vlanif 2
[HUAWEI-Vlanif2]ip address 192.168.1.2 24
[HUAWEI-Vlanif2]q
[HUAWEI]interface Vlanif 3
[HUAWEI-Vlanif3]ip address 192.168.2.2 24
[HUAWEI-Vlanif3]q
After completing the above configuration, you can use pc1 and pc2 for testing.
First ping your own gateway as well as the ip of the upper layer device to see if it's through; if it's a real device and you want two computers to access the Internet, you need to configure the public IP and gateway to be able to do so.
The above is the configuration scheme related to the connection between the router and the switch, have you learned it?