配置單臂路由 實現不同VLAN通信
分別給PC1 和PC2配置IP地址、子網掩碼和網關
進入系統視圖,給交換機配置vlan
檢查vlan是否創建成功 命令:display vlan
配置access接口,給端口配置Vlan
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 10
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 20
配置trunk接口
[Huawei-GigabitEthernet0/0/1]port link-type trunk
允許通過trunk接口的vlan
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
配置路由器信息
進入端口視圖
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R
[R]int g0/0/0.1 (子接口)
定義g0/0/0.1子接口與vlan10相關聯
[R-GigabitEthernet0/0/0.1]dot1q termination vid 10
[R-GigabitEthernet0/0/0.1]ip address 10.10.0.1 24
處理ARP消息(華為設備默認不處理,需要打開)
[R-GigabitEthernet0/0/0.1]arp broadcast enable
[R-GigabitEthernet0/0/0.1]int g0/0/0.2
[R-GigabitEthernet0/0/0.2]dot1q terminat
[R-GigabitEthernet0/0/0.2]dot1q termination vid 20
[R-GigabitEthernet0/0/0.2]ip address 10.20.0.1 24
[R-GigabitEthernet0/0/0.2]arp broadcast enable
測試,兩個vlan的主機互ping 看是否正常
經測試, 試驗成功
配置單臂路由 實現不同VLAN通信