LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-10-2005, 03:50 PM   #1
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
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?
 
Old 05-11-2005, 05:55 AM   #2
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Original Poster
Rep: Reputation: 31
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.
 
  


Reply


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
Crypto problem: LOOP_SET_STATUS: Invalid argument Slacker0815 Slackware 7 07-21-2005 05:13 PM
tc qdisc Invalid argument problem 4mix Linux - Networking 1 09-09-2004 04:26 PM
Problem assigning class D IPADDR because of SIOCIFADDR: Invalid argument clu Slackware 3 02-01-2004 07:06 AM
Dante sockd problem - Invalid argument (errno = 22) Sammy2ooo Linux - Networking 1 11-19-2003 07:22 AM
[ Invalid Argument on 'iptables' ] benleung Linux - Security 1 09-23-2003 12:25 AM


All times are GMT -5. The time now is 07:12 AM.

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