View the Most Wanted LQ Wiki articles.
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 05-10-2004, 05:45 PM   #1
Registered: May 2004
Distribution: SuSe v9.3 Professional
Posts: 33

Rep: Reputation: 15

How-To allow traffic by using a MAC address and IPTABLES ?

I've found that I need to use -m MAC --mac-source xx:xx:xx:xx:xx:xx

But this doesn't seem to work for me.

I want to forward incoming traffic from the internet (at port 3389) to an internal pc on my network (at port 3389 also) but only my Laptop's MAC address is allowed to connect to that port.

I've used this command:

${IPTABLES} -t nat -A PREROUTING -i eth0 -p tcp --dport 3389 -j DNAT --to-destination -m mac --mac-source xx:xx:xx:xx:xx
${IPTABLES} -A FORWARD -p tcp -i eth0 -d --dport 3389 -j ACCEPT

Without the -m mac specified, it works.

(This way even I can't connect to the port, security is to thight )

Old 05-10-2004, 09:36 PM   #2
Registered: Feb 2004
Location: Outermost mingetty
Distribution: RHEL3,RH4U4,Sol9, Sol10
Posts: 321

Rep: Reputation: 31
You will not see the MAC address of a host connected across the internet, only those on the same LAN as you.


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 rules with mac address? xpathfinder Linux - Security 3 12-11-2005 10:23 PM
Iptables/Mac address InJesus Linux - Security 3 11-17-2005 06:57 AM
blocking mac address using iptables Kendo1979 Linux - Networking 9 10-25-2004 05:09 AM
MAC address iptables questions scottman Linux - Security 2 10-01-2004 02:26 PM
logsnorter-0.2 iptables MAC address toovato Linux - Security 9 10-30-2003 07:47 AM

All times are GMT -5. The time now is 04:53 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