LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 04-13-2005, 02:05 AM   #1
houler
Member
 
Registered: Mar 2005
Distribution: Slackware 10.1, Kernel 2.6.14.4 (custom)
Posts: 166

Rep: Reputation: 30
MAC address filtering in Slackware?


Basically I want to add a mac address filter for a dhcp server in my network. Like I want there to be an access list with mac addresses inside and whatever mac address that isn't on the list will be denied dhcp service.

I'm using dhcpd from isc.org.

OS: SLackware 10
kernel: 2.6.11.7

Any ideas on how to accomplish this?
 
Old 04-13-2005, 02:59 AM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
This should provide some information
Code:
iptables -m mac help
 
Old 04-13-2005, 03:09 AM   #3
chrisfirestar
Member
 
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Rep: Reputation: 30
I suggest you use IPTABLES for this, you can use the following:

$IPTABLES -A INPUT -m mac --mac-source 08:00:46:99:CB:96 -j ACCEPT

this way it will not be able to access any services, not just DHCP
 
Old 04-13-2005, 03:11 AM   #4
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi,

2 ways : you can use "hardware address" entries in dhcpd.conf :
Code:
host lazarus {
  hardware ethernet 00:0C:6E:8D:F3:49;
  fixed-address lazarus;
  option broadcast-address 192.168.0.255;
  option routers aracaju;
}
But then you'll have an entry per host on your network... a bit complicated for a daily admin task

Or you can use iptables :
Write a mac-address per line in a file that I've called in this sample mac-list and then
Code:
for MAC in $(cat mac-list) ; do
iptables -A INPUT -p udp --dport 67 -m mac --mac-source $MAC -j ACCEPT
done
iptables -A INPUT -p udp --dport 67 -j DROP
Thus you only disallow dhcp
 
Old 04-13-2005, 03:27 AM   #5
houler
Member
 
Registered: Mar 2005
Distribution: Slackware 10.1, Kernel 2.6.14.4 (custom)
Posts: 166

Original Poster
Rep: Reputation: 30
Thanks for help

I think I'll do the iptables approach.
 
Old 04-13-2005, 07:37 AM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,785
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Just be aware that it is pretty trivial to spoof a MAC address, so don't rely on this for any serious level of security.
 
Old 05-11-2006, 07:32 PM   #7
GATTACA
Member
 
Registered: Feb 2002
Location: USA
Distribution: Fedora, CENTOS
Posts: 201

Rep: Reputation: 32
Quote:
Originally Posted by Hangdog42
Just be aware that it is pretty trivial to spoof a MAC address, so don't rely on this for any serious level of security.
I'm trying to do something similar. I want to restrict SSH access into my slackware box to just one computer (my laptop). I was going to use the laptop's mac address for this but you suggest this doesn't provide enough/much security. I would have thought it was relatively difficult to guess the correct mac address to connect to a machine. (I don't know much about security so if this is a dumb question I apollogize.)
 
Old 05-12-2006, 12:17 AM   #8
theoffset
Member
 
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 30
Quote:
I'm trying to do something similar. I want to restrict SSH access into my slackware box to just one computer (my laptop). I was going to use the laptop's mac address for this but you suggest this doesn't provide enough/much security. I would have thought it was relatively difficult to guess the correct mac address to connect to a machine. (I don't know much about security so if this is a dumb question I apollogize.)
This is indeed too insecure. Anyone sniffing your network could get your mac address (since that's public information). You could try "tcpdump -e" (Has to be run as root. You may need some other flags. Tcpdump is included in Slackware) and you'll see it by your self.

Why don't simply use a good old password? or a ssh-key which is only being kept in your laptop?
 
Old 05-12-2006, 06:15 AM   #9
GATTACA
Member
 
Registered: Feb 2002
Location: USA
Distribution: Fedora, CENTOS
Posts: 201

Rep: Reputation: 32
Quote:
Originally Posted by theoffset
This is indeed too insecure. Anyone sniffing your network could get your mac address (since that's public information). You could try "tcpdump -e" (Has to be run as root. You may need some other flags. Tcpdump is included in Slackware) and you'll see it by your self.

Why don't simply use a good old password? or a ssh-key which is only being kept in your laptop?
I intend to use a good password too. I was looking for extra security measures.
Although I didn't think of the SSH key idea.
 
Old 05-12-2006, 07:34 AM   #10
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,785
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
I second the key idea (have a read through this for good instrucions). Using keys would restrict access to only those machines that have the appropriate counterpart, so if you have a private key on your laptop and the public key on the server, only your laptop can gain access.

Provided you keep your private key private.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving cloned MAC address in Slackware darreng23 Linux - Networking 1 04-20-2005 06:36 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
Questions on DHCP Filtering via MAC address brainee28 Linux - Networking 1 02-03-2005 02:11 PM
Slackware 10 dhcpcd MAC address on a laptop questions jtp51 Slackware 12 10-14-2004 12:38 PM
MAC address filtering firewall? gigaah Linux - Security 5 06-07-2004 11:05 AM


All times are GMT -5. The time now is 05:42 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration