华为设备----单臂路由

华为设备----单臂路由_第1张图片
SW1:
undo terminal monitor
system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]quit
[Huawei]vlan batch 10 20

[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 10
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port hybrid pvid vlan 20
[Huawei-Ethernet0/0/2]port hybrid untagged vlan 20

[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

R1:
undo terminal monitor
system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]quit

[Huawei]int g0/0/1.1 进入g0/0/1的子端口子端口号为1即g0/0/1.1
[Huawei-GigabitEthernet0/0/1.1]ip address 192.168.1.1 24添加一个IP
[Huawei-GigabitEthernet0/0/1.1]vlan-type dot1q 10 default
此端口使用dot1q协议封装数据发送到vlan 10
[Huawei]int g0/0/1.2
[Huawei-GigabitEthernet0/0/1.2]ip address 192.168.2.1 24
[Huawei-GigabitEthernet0/0/1.2]vlan-type dot1q 20 default

交换机
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 10
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10
只要放行自己所在的vlan,使用网关通信

你可能感兴趣的:(华为设备----单臂路由)