拓撲圖以下網絡
配置步驟ide
R1 路由器測試
<Huawei>sys
[Huawei]sysname R1
[R1]int g0/0/0.10
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10
//封裝dot1q協議,該子接口對應vlan103d[R1-GigabitEthernet0/0/0.10]ip add 192.168.10.1 24
[R1-GigabitEthernet0/0/0.10]arp broadcast enable
//開啓arp廣播blog[R1-GigabitEthernet0/0/0.10]interface g0/0/0.20
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]ip address 192.168.20.1 24
[R1-GigabitEthernet0/0/0.20]arp broadcast enable接口
LSW1交換機ip
<Huawei>sys
[Huawei]sysname sw1
[SW1]vlan batch 10 20
//建立vlan10 20路由[SW1]int e0/0/1
[SW1-Ethernet0/0/1]port link-type access
//配置access鏈路it[SW1-Ethernet0/0/1]port default vlan 10
//接口劃入vlan10io[SW1-Ethernet0/0/1]undo shutdown
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 20
[SW1-Ethernet0/0/2undo shutdown
[SW1-Ethernet0/0/2]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
//配置trunk鏈路[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
//設置放行全部vlan[SW1-GigabitEthernet0/0/1]undo sh
配置PC端IP地址及網關
測試網絡互聯互通