-   Linux - Networking (
-   -   MAC Address + IPTABLES (

yvesg 05-10-2004 04:45 PM

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 :) )

RHELL 05-10-2004 08:36 PM

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

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