cisco三层交换机配置dhcp
时间: 2023-08-13 21:08:09 浏览: 120
要配置Cisco三层交换机作为DHCP服务器,为每个VLAN分配IP,需要按照以下步骤进行配置:
1. 首先进入交换机的全局配置模式:
```
enable
configure terminal
```
2. 创建并命名VLAN:
```
vlan 10
name vlan10
exit
vlan 20
name vlan20
exit
vlan 30
name vlan30
exit
```
3. 配置每个VLAN的虚拟接口地址并启用接口:
```
interface vlan 10
ip address 192.168.10.1 255.255.255.0
no shutdown
exit
interface vlan 20
ip address 192.168.20.1 255.255.255.0
no shutdown
exit
interface vlan 30
ip address 192.168.30.1 255.255.255.0
no shutdown
exit
```
4. 为每个VLAN生成地址池,并设置默认路由(网关)为各VLAN虚拟接口地址:
```
ip dhcp pool 10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
ip dhcp excluded-address 192.168.10.1
exit
ip dhcp pool 20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
ip dhcp excluded-address 192.168.20.1
exit
ip dhcp pool 30
network 192.168.30.0 255.255.255.0
default-router 192.168.30.1
ip dhcp excluded-address 192.168.30.1
exit
```
通过以上配置,你可以将Cisco三层交换机配置为DHCP服务器,为每个VLAN分配相应的IP地址。
阅读全文