LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Iptables, invalid argument, problem with modprobe (https://www.linuxquestions.org/questions/linux-software-2/iptables-invalid-argument-problem-with-modprobe-322101/)

ivanatora 05-10-2005 03:50 PM

Iptables, invalid argument, problem with modprobe
 
I want to lock certain IP to a MAC address and I tried that:
iptables -t nat -A POSTROUTING -s 1.2.3.4 -m mac --mac-source aa:bb:cc:dd -j SNAT --to-source 192.168.1.2
iptables -t nat -A POSTROUTING -s 1.2.3.4 -j DROP
But after the first line I got:
iptables: Invalid argument
Here is what I got from lsmod (hm.. I know mac match support is compiled into the kernel):
Code:

Module                  Size  Used by    Not tainted
ipt_REDIRECT            696  1  (autoclean)
8139too                16040  2
mii                    2368  0  [8139too]

And here is what locate gave me:
Code:

# locate ipt |grep mac
/lib/modules/2.4.20/kernel/net/ipv4/netfilter/ipt_mac.o.gz
/usr/lib/iptables/libip6t_mac.so
/usr/lib/iptables/libipt_mac.so
/usr/src/linux-2.4.22/net/ipv4/netfilter/ipt_mac.c
/usr/src/linux-2.4.22/include/linux/netfilter_ipv4/ipt_mac.h
/usr/local/lib/iptables/libip6t_mac.so
/usr/local/lib/iptables/libipt_mac.so
/usr/local/src/libpng/scripts/makefile.macosx
/usr/include/linux/netfilter_ipv4/ipt_mac.h

I tried to load a module:
modprobe libipt_mac
modprobe ipt_mac
, but always got modprobe: Can't locate module...
And one more thing: I'm using source-compiled version of iptables: v1.3.0rc1
Where could be the problem in that setup?

ivanatora 05-11-2005 05:55 AM

The problem is solved. The mac match doesn't work in POSTROUTING, but in PREROUTING, so I put it there with target ACCEPT. Then added different rule for SNAT. So that was.


All times are GMT -5. The time now is 11:26 AM.