实验环境华为ENSP模拟器下
如图
1.R1配置单臂路由:
[R1]int GigabitEthernet 0/0/0.10
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10
[R1-GigabitEthernet0/0/0.10]ip address 10.1.1.100 24
[R1-GigabitEthernet0/0/0.10]arp broadcast enable
[R1-GigabitEthernet0/0/0.10]quit
[R1]int GigabitEthernet 0/0/0.20
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]ip address 20.1.1.100 24
[R1-GigabitEthernet0/0/0.20]arp broadcast enable
[R1-GigabitEthernet0/0/0.20]quit
1.SW1创建vlan10、vlan20
2.SW1将接口划入对应vlan
3.SW1将连接路由器的接口配为trunk:
[SW1]int Ethernet0/0/1
[SW1-Ethernet0/0/1]port link-type trunk
[SW1-Ethernet0/0/1]port trunk allow-pass vlan all
[SW1-Ethernet0/0/1]quit