#修改设备名:
sysname + xxx
#进入全局配置模式:
configuration terminal
配置端口
#进入全局配置模式
configuration terminal
#进入接口
interface e0/0
#进入接口组
interface range e0/0-e0/n
#设置接口模式为access
switchport mode access
#设置接口模式为trunk
switchport trunk encapsulation dot1q
switchport mode trunk
#放行vlan
switchport access vlan 10
switchport trunk allowed vlan 10
switchport trunk allowed add vlan 20
配置DHCP
1.进入全局配置模式
enable
configuration terminal
2.配置DHCP地址池
ip dhcp pool [poolname]
network [network-address] [subnet-mask] //指定ip地址池和子网掩码
default-router [gateway-address] //指定默认网关地址
dns-server [dns-server-address] //指定dns服务器地址
lease [days] [hours] [minutes] //配置租期
ip dhcp excluded address [ip-address] [ip-address]
3.保存配置
end //退出配置模式
copy running-config startup-config //保存配置
4.启用DHCP地址池
service dhcp
5.配置DHCP中继
interface [interface-name] //进入相应接口
ip helper-address [dhcp-server-address] //指定DHCP服务器的地址
6.配置选项43,用于指定AC控制器的IP地址
option 43 hex [hexadecimal-string]
7.验证DHCP服务器配置
show ip dhcp pool [pool-name]
8.故障排除
debug ip dhcp server events //启用DHCP服务器调试