DHCP中繼 vlan
拓?fù)?/strong>

交換機(jī)啟用中繼功能,路由器配置兩個(gè)vlan的地址池
pool10給vlan10分配ip,pool20給vlan20分配ip
# pool10
# 地址池
192.168.10.0/24
# dns
8.8.8.8
# 網(wǎng)關(guān)
192.168.10.1
------------------------------------------
# pool20
# 地址池
192.168.20.0/24
# dns
8.8.8.8
# 網(wǎng)關(guān)
192.168.10.1
# 創(chuàng)建vlan
vlan batch 10 20 100
# 全局啟用DHCP
dhcp enable
# 配置接口
int g0/0/1
port link-type access
port default vlan 100
int g0/0/2
port link-type access
port default vlan 10
int g0/0/3
port link-type access
port default vlan 20
# 配置vlan口ip
int vlanif 100
ip add 192.168.100.1 24
int vlanif 10
ip add 192.168.10.1 24
int vlanif 20
ip add 192.168.20.1 24
# vlan口dhcp配置
int vlanif 10
dhcp select relay
dhcp relay server-ip 192.168.100.2
int vlanif 20
dhcp select relay
dhcp relay server-ip 192.168.100.2
# 配置接口
int g0/0/1
ip add 192.168.100.2 24
# 啟用DHCP
dhcp enable
# 配置地址池
ip pool pool10
network 192.168.10.0 mask 24
dns-list 8.8.8.8
gateway-list 192.168.10.1
lease day 2
q
ip pool20
network 192.168.20.0 mask 24
dns-list 8.8.8.8
gateway-list 192.168.10.1
lease day 2
# 接口啟用DHCP
int g0/0/1
dhcp select global
# 配置靜態(tài)路由
ip route-static 192.168.10.0 24 192.168.100.1
ip route-static 192.168.20.0 24 192.168.100.1