MAC filtering

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
meelbo
DD-WRT Novice


Joined: 14 Apr 2012
Posts: 3

PostPosted: Sat Apr 14, 2012 8:20    Post subject: MAC filtering Reply with quote
I want to make one script with a limitation based on the MAC, that do not allocate an IP via DHCP only if exist in a predefined list of MAC.

Please help me.

LE: via LAN !

Router: Linksys WRT54GL
Firmware: DD-WRT v24-sp1 ( 07/27/08 ) std-special
Sponsor
mjurgens
DD-WRT Novice


Joined: 12 Jan 2011
Posts: 40

PostPosted: Sat Apr 14, 2012 11:06    Post subject: A couple of ways at least Reply with quote
There are at least a couple of ways you could do this.

Look at the dnsmasq config file in this post
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=153494

You could just assign a bogus IP range for the MAC addresses in your list (see the dhcp reservations the end of the config file)

Perhaps you could use iptables to block those MAC addresses from accessing your DHCP service. I think its UDP port 68 (maybe 67)

I'm not exactly sure which chain the DHCP client broadcast would hit (maybe INPUT), so you might want to check that.

Also, I'm guessing they will come in on the br0 interface.

Your iptables command for an individual MAC might be something like:
iptables -I INPUT -i br0 -p udp --dport 67:68 -m mac --mac-source 00:12:34:56:78:9A -j DROP

You'll probably need to also do one of these before run the iptables mac matching commands -
insmod xt_mac #k2.6 module name
insmod ipt_mac #k2.4 module name
meelbo
DD-WRT Novice


Joined: 14 Apr 2012
Posts: 3

PostPosted: Sat Apr 14, 2012 14:00    Post subject: Reply with quote
More details in picture:



Uploaded with ImageShack.us

Important: All other MAC is unknow !!
meelbo
DD-WRT Novice


Joined: 14 Apr 2012
Posts: 3

PostPosted: Sat Apr 14, 2012 19:13    Post subject: Reply with quote
I do not know how this thing is ok but I solved the problem this way:
SETUP -> BASIC SETUP
- DHCP = ON
- Start IP Address = 254
- Maximum DHCP Users: 0
SERVICES -> SERVICES -> Static Leases
- Add MAC address and assign manual IP

Now, DHCP is enabled but no IP distribute if not in List.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum