中国网管论坛's Archiver

liyi20060101 发表于 2007-5-9 17:57

DHCP 、MAC、IP、端口绑定

条件:
1、4506核心交换机,2950交换机接用户端;
2、划分多个VLAN,不同VLAN从DHCP服务器获取IP(已实现);
3、端口与用户端MAC地址绑定(已实现);
现在希望能把用户的IP地址与端口绑定,防止用户配用其他IP;但是用户能通过DHCP获得IP。

[[i] 本帖最后由 liyi20060101 于 2007-5-10 14:34 编辑 [/i]]

yonx 发表于 2007-5-9 19:04

我们有没有一种办法能够限定普通用户必须使用自动获得IP地址的方法来上网呢?如果可以限制的话,那么非法用户即使修改自己的IP地址与MAC地址为合法信息也无法正常上网。一般来说我们可以在路由交换设备上启用DHCP SNOOPING功能。不过这个功能并不是所有设备都有的,使用前请仔细查询说明书。DHCP SNOOPING使用的方法是采用DHCP方式为用户分配IP,然后限定这些用户只能使用动态IP的方式,如果改成静态IP的方式则不能连接上网络。以下是一个简单的例子。

version 12.1
no service pad
service timestamps debug uptime
service timestamps log uptime
no service pas sword-encryption
service compress-config
!
hostname C4-2_4506
!
enable password xxxxxxx!
clock timezone GMT 8
ip subnet-zero


no ip domain-lookup
!
ip dhcp snooping vlan 180-181 // 对哪些VLAN 进行限制
ip dhcp snooping
ip arp inspection vlan 180-181
ip arp inspection validate src-mac dst-mac ip




errdisable recovery cause udld
errdisable recovery cause bpduguard
errdisable recovery cause security-violation
errdisable recovery cause channel-misconfig
errdisable recovery cause pagp-flap
errdisable recovery cause dtp-flap
errdisable recovery cause link-flap
errdisable recovery cause l2ptguard
errdisable recovery cause psecure-violation
errdisable recovery cause gbic-invalid
errdisable recovery cause dhcp-rate-limit
errdisable recovery cause unicast-flood
errdisable recovery cause vmps
errdisable recovery cause arp-inspection
errdisable recovery interval 30
spanning-tree extend system-id
!
!

interface GigabitEthernet2/1 // 对该端口接入的用户进行限制,可以下联交换机
ip arp inspection limit rate 100
arp timeout 2
ip dhcp snooping limit rate 100
!



interface GigabitEthernet2/2
ip arp inspection limit rate 100
arp timeout 2
ip dhcp snooping limit rate 100
!
interface GigabitEthernet2/3
ip arp inspection limit rate 100
arp timeout 2
ip dhcp snooping limit rate 100
!
interface GigabitEthernet2/4
ip arp inspection limit rate 100
arp timeout 2
ip dhcp snooping limit rate 100
--More--

liyi20060101 发表于 2007-5-10 08:28

谢谢yonx (笑小虾),我先测试下。

liyi20060101 发表于 2007-5-10 14:38

好像不行呢,帮我看看是不是我配的不正确?
ip dhcp snooping vlan 201
ip dhcp snooping
ip arp inspection vlan 201
ip arp inspection validate src-mac dst-mac ip
!
no file verify auto
errdisable recovery cause udld
errdisable recovery cause bpduguard
errdisable recovery cause security-violation
errdisable recovery cause channel-misconfig
errdisable recovery cause pagp-flap
errdisable recovery cause dtp-flap
errdisable recovery cause link-flap
errdisable recovery cause gbic-invalid
errdisable recovery cause l2ptguard
errdisable recovery cause psecure-violation
errdisable recovery cause dhcp-rate-limit
errdisable recovery cause unicast-flood
errdisable recovery cause vmps
errdisable recovery cause storm-control
errdisable recovery cause arp-inspection
errdisable recovery cause loopback
errdisable recovery interval 30
spanning-tree mode pvst
spanning-tree extend system-id
power redundancy-mode redundant

yonx 发表于 2007-5-10 14:41

还要在端口上应用

interface GigabitEthernet2/1 // 对该端口接入的用户进行限制,可以下联交换机
ip arp inspection limit rate 100
arp timeout 2
ip dhcp snooping limit rate 100

liyi20060101 发表于 2007-5-10 14:51

哦,好谢谢。我下级交换机是2950,不支持IP ARP的功能,是不是不能实现了?

yonx 发表于 2007-5-10 15:21

2950是不支持DAI,你在4506上设置就行了

2950上可以设置DHCP SNOOPING的

liyi20060101 发表于 2007-5-11 16:43

我在核心交换机上启用了,但2950上不启用,没有什么用
但在2950加IP DHCP SNOOPING;IP DHCP SNOOPING后,分配不到IP

yonx 发表于 2007-5-11 17:16

我这没设备,不能实验

interface GigabitEthernet2/1 // 对该端口接入的用户进行限制,可以下联交换机
看这句话的意思应该是只在4506上设置就行了

liyi20060101 发表于 2007-5-17 19:52

设了过后,第一次可以分到IP地址,要想重新获取也不行。

yonx 发表于 2007-5-17 22:35

既然第一次可以分到,那就说明是正确的,后来是不是出了其他问题呢?

legendchow 发表于 2007-9-28 00:09

很深奥啊

qiuzhejun 发表于 2007-9-30 10:05

8错

yifei191016110 发表于 2007-10-13 21:39

学习下

页: [1]

Powered by Discuz! Archiver 6.1.0  © 1999-2008 bbs.bitsCN.com