1、配置基本信息,交换机SW1/SW2/AC创建vlan100/101/102/103/104。修改接口模式
1)SW1配置
interface GigabitEthernet0/0/1 进入接口
port link-type trunk 模式为trunk
port trunk pvid vlan 100 修改PVID值为vlan100
port trunk allow-pass vlan all 允许所有vlan通过
interface GigabitEthernet0/0/2 进入接口
port link-type trunk 模式为trunk
port trunk pvid vlan 100 修改PVID值为vlan100
port trunk allow-pass vlan all 允许所有vlan通过
interface GigabitEthernet0/0/3 进入接口
port link-type trunk 模式为trunk
port trunk pvid vlan 100 修改PVID值为vlan100
port trunk allow-pass vlan all 允许所有vlan通过
interface GigabitEthernet0/0/4 进入接口
port link-type trunk 模式为trunk
port trunk pvid vlan 100 修改PVID值为vlan100
port trunk allow-pass vlan all 允许所有vlan通过
interface GigabitEthernet0/0/5 进入接口
port link-type trunk 模式为trunk
port trunk allow-pass vlan all 允许所有vlan通过
2)SW2配置
interface GigabitEthernet0/0/1 进入接口
port link-type trunk 模式为trunk
port trunk allow-pass vlan all
interface GigabitEthernet0/0/2 进入接口
port link-type access 模式为access
port default vlan 210 到场到vlan210
interface GigabitEthernet0/0/3 进入接口
port link-type access 模式为access
port default vlan 200 到场到vlan200
2、在交换机SW2上面配置每个vlan的网关IP地址
interface Vlanif100
ip address 192.168.100.254 255.255.255.0
interface Vlanif101
ip address 192.168.101.254 255.255.255.0
interface Vlanif102
ip address 192.168.102.254 255.255.255.0
interface Vlanif103
ip address 192.168.103.254 255.255.255.0
interface Vlanif104
ip address 192.168.104.254 255.255.255.0
interface Vlanif200
ip address 192.168.200.254 255.255.255.0
interface Vlanif210
ip address 192.168.210.254 255.255.255.0
3、配置DHCP接口IP地址并配置默认路由,确保能与100/200网段可以互通
interface GigabitEthernet0/0/0
ip address 192.168.210.1 255.255.255.0
ip route-static 0.0.0.0 0.0.0.0 192.168.210.254 配置默认路由
4、配置DHCP协议
ip pool vlan100
gateway-list 192.168.100.254
network 192.168.100.0 mask 255.255.255.0
option 43 sub-option 3 ascii 192.168.200.1
ip pool vlan101
gateway-list 192.168.101.254
network 192.168.101.0 mask 255.255.255.0
dns-list 8.8.8.8
ip pool vlan102
gateway-list 192.168.102.254
network 192.168.102.0 mask 255.255.255.0
dns-list 8.8.8.8
ip pool vlan103
gateway-list 192.168.103.254
network 192.168.103.0 mask 255.255.255.0
dns-list 8.8.8.8
ip pool vlan104
gateway-list 192.168.104.254
network 192.168.104.0 mask 255.255.255.0
dns-list 8.8.8.8
dhcp select global 进入0/0/0接口开启全局
5、在交换机sw2上配置中继并指向DHCP服务器,确保AP能够获取到IP地址
interface Vlanif100
ip address 192.168.100.254 255.255.255.0
dhcp select relay
dhcp relay server-ip 192.168.210.1