# iptables and snat mac

## akam

Hello, please tell me how to distribute the Internet for mac address. It does not work: *Quote:*   

> 
> 
> $IPTABLES -t nat -o $INET_IFACE -A POSTROUTING -m mac --mac-source 60:a1:0a:a7:fe:a7 -j SNAT --to-source $INET_IP
> 
> [17754.083715] x_tables: ip_tables: mac match: used from hooks POSTROUTING, but only valid from PREROUTING/INPUT/FORWARD

 

----------

## truc

what exactly are you trying to do? (and why do you need that?) You usually don't need to do what you want to share an internet connection

----------

## akam

im trying to share internet to smartphones (over wifi). they are geting dynamic ip via dhcp (dont offer to reserve ip)

(sorry for my bad english)

----------

## Hu

If you only need to let the client devices connect outbound, then just use -j MASQUERADE instead of -j SNAT.  You do not need to munge the MAC address.

----------

