配置一台华为交换机 设置三个vlan 每个vlan划分五个接口包括门禁 监控 报警
时间: 2023-05-19 09:04:08 浏览: 373
以下是配置华为交换机设置三个vlan,每个vlan划分五个接口包括门禁、监控、报警的示例代码:
1. 创建三个vlan
vlan batch 10 20 30
2. 配置vlan 10
interface Vlanif10
ip address 192.168.10.1 24
quit
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
quit
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
quit
interface GigabitEthernet0/0/3
port link-type access
port default vlan 10
quit
interface GigabitEthernet0/0/4
port link-type access
port default vlan 10
quit
interface GigabitEthernet0/0/5
port link-type access
port default vlan 10
quit
3. 配置vlan 20
interface Vlanif20
ip address 192.168.20.1 24
quit
interface GigabitEthernet0/0/6
port link-type access
port default vlan 20
quit
interface GigabitEthernet0/0/7
port link-type access
port default vlan 20
quit
interface GigabitEthernet0/0/8
port link-type access
port default vlan 20
quit
interface GigabitEthernet0/0/9
port link-type access
port default vlan 20
quit
interface GigabitEthernet0/0/10
port link-type access
port default vlan 20
quit
4. 配置vlan 30
interface Vlanif30
ip address 192.168.30.1 24
quit
interface GigabitEthernet0/0/11
port link-type access
port default vlan 30
quit
interface GigabitEthernet0/0/12
port link-type access
port default vlan 30
quit
interface GigabitEthernet0/0/13
port link-type access
port default vlan 30
quit
interface GigabitEthernet0/0/14
port link-type access
port default vlan 30
quit
interface GigabitEthernet0/0/15
port link-type access
port default vlan 30
quit
注意:以上代码仅供参考,实际配置需要根据具体情况进行调整。
阅读全文