核心计算机不配置dhcp,在核心交换机上配置DHCP做静态绑定严格限制地址分配(示例代码)...

拓扑图

c333ebe10e878abd2043870e7025af39.png

S5700作为核心设备,配置DHCP,为办公网络分配IP地址

S2700作为接入设备

S5700配置

vlan 100

description bangong

interface GigabitEthernet0/0/1

port link-type trunk

port trunk allow-pass vlan 100

interface Vlanif100

ip address 192.168.10.254 255.255.255.0

S2700配置

vlan 100

description bangong

interface Ethernet0/0/1

port link-type trunk

port trunk allow-pass vlan 100

interface Ethernet0/0/2

port link-type access

port default vlan 100

interface Ethernet0/0/3

port link-type access

port default vlan 100

interface Ethernet0/0/4

port link-type access

port default vlan 100

开启DHCP

dhcp enable

配置地址池,并做静态绑定,PC1只能获取到192.168.10.1 PC2只能获取到192.168.10.2 剩余地址保留,不做分配,防止外部人员接入。

ip pool bangong

gateway-list 192.168.10.254

network 192.168.10.0 mask 255.255.255.0

static-bind ip-address 192.168.10.1 mac-address 5489-98e7-7f28

static-bind ip-address 192.168.10.2 mac-address 5489-98d8-4d8c

excluded-ip-address 192.168.10.3 192.168.10.253

dns-list 8.8.8.8

在虚接口下启用全局dhcp

interface Vlanif100

ip address 192.168.10.254 255.255.255.0

dhcp select global

在PC上验证分配的地址

PC1

22fe9440c80eb245784d8aeab525f1ca.png

a3f565c626c11005e0192c306c6fa02d.png

PC2

20e86f0a9b37a50138a253fea361cf51.png

a129f8c65daeb046adb30faa7ef13b81.png

我们断开PC2网线,假设PC2没有接入,验证PC3是否能获取DHCP分配给PC2的地址

3572426e0f0064e681b1128787bbca25.png

d1845188689b1f1d230a7579fdebf188.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值