Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-26-2008, 05:46 AM   #1
LQ Newbie
Registered: Nov 2006
Posts: 4

Rep: Reputation: 0
iptables filtering by MAC address

i'm trying to give access to our server at work port 443 using mac addresses.
I found my pc mac address using getmac command in cmd (vista) -

Physical Address    Transport Name
=================== ==========================================================
xx-xx-xx-xx-xx-xx   \Device\Tcpip_{yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy}
then i added it to the firewall using this command -
iptables -I INPUT 1 -p tcp --destination-port 443 -m mac --mac-source xx:xx:xx:xx:xx:xx -j ACCEPT
But, for some reason this does not work (the firewall blocking me).
Can someone tell me what else i need to check to make this work?
Thank you!

Last edited by bigsmile; 09-26-2008 at 05:48 AM.
Old 09-27-2008, 06:32 AM   #2
Registered: Sep 2008
Posts: 44

Rep: Reputation: 15
I've never seen anyone use the mac address as the match. The man page suggests XX:XX:XX:XX:XX:XX rather than xx:xx:xx:xx:xx:xx. I guess you could try capitals.

I would run "tcpdump host <ipaddress>" to see what is really happening.

Last edited by david_ross; 10-09-2008 at 01:09 PM. Reason: removed spam
Old 09-27-2008, 07:51 PM   #3
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
MAC addresses only work inside your LAN, so if you are trying to access the server at work from your home PC, the MAC address the server will see is the one for the last hop in your LAN (usually the MAC of your gateway's LAN interface) - not your home PC's MAC.

Last edited by win32sux; 09-27-2008 at 08:15 PM.


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
iptables + mac address filtering Roko Linux - Networking 1 09-10-2008 08:38 AM
can mac address filtering be done from the internet? yongitz Linux - Networking 9 04-19-2007 02:45 AM
MAC address filtering in Slackware? houler Linux - Networking 9 05-12-2006 08:34 AM
mac address filtering gabsik Linux - Security 8 04-27-2006 09:23 AM
MAC address filtering firewall? gigaah Linux - Security 5 06-07-2004 12:05 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:06 AM.

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