关于华为交换机VLAN配置问题
发布网友
发布时间:2022-04-22 13:13
我来回答
共1个回答
热心网友
时间:2022-04-12 22:27
交换机上设置,划分VLAN:
sys
//切换到系统视图
[Quidway]vlan enable
[Quidway]vlan 2
[Quidway-vlan2]port e0/1 to e0/8
[Quidway-vlan2]quit
//默认所有端口都属于VLAN1,指定交换机的e0/1 到e0/8八个端口属于VLAN2
[Quidway]vlan 3
[Quidway-vlan3]port e0/9 to e0/16
[Quidway-vlan3]quit
//指定交换机的e0/9 到e0/16八个端口属于VLAN3
[Quidway]dis vlan all
[Quidway]dis cu
路由器上设置,实现访问控制:
[Router]interface ethernet 0
[Router-Ethernet0]ip address 192.168.1.5 255.255.255.0
[Router-Ethernet0]quit
//指定ethernet 0的ip
[Router]interface ethernet 1
[Router-Ethernet1]ip address 192.168.1.6 255.255.255.0
[Router-Ethernet1]quit
//开启firewall,并将默认设置为deny
[Router]fire enable
[Router]fire default deny
//允许192.168.1.1访问192.168.1.3
//firewall策略可根据需要再进行添加
[Router]acl 101
[Router-acl-101]rule permit ip source 192.168.1.1 255.255.255.0 destination 192.168.1.3 255.255.255.0
[Router-acl-101]quit
//启用101规则
[Router-Ethernet0]fire pa 101
[Router-Ethernet0]quit
[Router-Ethernet1]fire pa 101
[Router-Ethernet1]quit