查看當前配置: display cur
進入配置模式: system-view
修改交換機名字: sysname huawei
創(chuàng)建vlan(創(chuàng)建后自動進入vlan): vlan30 quit //退出vlan
給vlan配置IP地址 interface Vlanif 30 ip address 192.168.30.1 255.255.255.0 dhcp select global dhcp enable
undo dhc enable //關閉DHCP
將端口3加入vlan30 進入端口3: interface GigabitEthernet 0/0/3 port link-type access port default vlan 30 quit 退出端口
配置IP地址池: ip pool 30 gateway-list 192.168.30.1 network 192.168.30.1 mask 255.255.255.0 excluded-ip-address 192.168.30.2 192.168.30.99 //排除IP不參與DHCP excluded-ip-address 192.168.30.200 192.168.254 //排除IP不參與DHCP dns-list 61.139.2.69 8.8.8.8
//刪除IP地址池:undo ip pool 30
保存配置: save
ACL限制不同VLAN之間的訪問:
acl number 3002 rule deny ip source 192.168.20.0 0.0.0.255 destination 192.168.30.0 0.0.0.255
acl number 3003 rule deny ip source 192.168.30.0 0.0.0.255 destination 192.168.20.0 0.0.0.255
用traffic-filter在vlan下應用ACL: traffic-filter vlan 20 inbound acl 3002 traffic-filter vlan 30 inbound acl 3003
刪除ACL,首先解除ACL調用關系: undo traffic-filter vlan 20 inbound acl 3002 undo traffic-filter vlan 30 inbound acl 3003
刪除ACL undo acl 3002 undo acl 3003 quit save //保存生效
將端口4加入VLAN30: system-view interface GigabitEthernet 0/0/4 port link-type access port default vlan 30
端口組:(同時設置多個端口) system-view port-group 34 //組名 group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 //端口范圍 port link-type access port default vlan 20 //3 4 端口加入VLAN20
根據(jù)IP地址查看MAC地址: dis arp | include 192.168.50.1
|