1.DHCP策略VLAN
DHCP策略VLAN分为三种类型,优先级由高至低依次为:基于MAC地址的DHCP策略VLAN,基于接口的DHCP策略VLAN,普通的DHCP策略VLAN。
1.配置DHCP策略VLAN
[SwitchB]vlan 10
[SwitchB]ip-subnet-vlan 1 ip 10.10.10.1 255.255.255.0 #设置IP地址为10.10.10.1/24的报文,在vlan10域内转发
[SwitchB]dhcp policy-vlan mac-address 0081-01fa-2134 #配置基于MAC地址DHCP策略VLAN,
使得拥有此MAC的新主机通过DHCP服务器获取到合法地址
[SwitchB]vlan 20
[SwitchB-vlan20]ip-subnet-vlan 1 ip 10.10.20.1 255.255.255.0
[SwitchB-vlan20]dhcp policy-vlan port Ethernet 0/0/3 #配置基于端口DHCP策略VLAN,
使得接入此接口的新主机通过DHCP服务器获取到合法地址
[SwitchB]int Ethernet 0/0/2
[SwitchB-Ethernet0/0/2]port hybrid untagged vlan 10
[SwitchB-Ethernet0/0/2]ip-subnet-vlan enable #开启基于子网划分VLAN功能
[SwitchB]int Ethernet 0/0/3
[SwitchB-Ethernet0/0/2]port hybrid untagged vlan 20
[SwitchB-Ethernet0/0/2]ip-subnet-vlan enable #开启基于子网划分VLAN功能
在SwitchC上配置普通的DHCP策略VLAN功能
[SwitchC]vlan 30
[SwitchB vlan 30]ip-subnet-vlan ip 10.10.30.1.24
[SwitchB vlan 30]dhcp policy-vlan generic //配置普通的DHCP策略VLAN功能
[SwitchB vlan 30]quit
- 配置限制每个端口只能学习1个终端设备的MAC地址,具体如下:
interface GigabitEthernet 0/0/1
port-security enable
port-security-mac-num mac-number 1
标签:VLAN,ip,vlan,SwitchB,DHCP,port
From: https://www.cnblogs.com/myLu01/p/18534306