Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables: Invalid argument
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
JaquesStrap
n00b
n00b


Joined: 01 Jul 2003
Posts: 47

PostPosted: Sun Jan 25, 2004 10:35 pm    Post subject: iptables: Invalid argument Reply with quote

With the 2.4.22 series of kernels the following command fails with the error "iptables: Invalid argument"
iptables -t nat -A POSTROUTING -o ppp0 -s 10.0.0.0/24 -j SNAT --to-source XXX.XXX.XXX.XXX

I can boot back to 2.4.20 and everything works fine.

Any suggestions are appreciated.
-JS

Code:

Linux Hades 2.4.22-gentoo-r5 #2 Sat Jan 24 12:42:10 EST 2004 i686 AMD Duron(tm) processor AuthenticAMD GNU/Linux

Module                  Size  Used by    Not tainted
ipt_TOS                 1048  16  (autoclean)
ipt_REJECT              3512   1  (autoclean)
ipt_LOG                 3384 113  (autoclean)
iptable_filter          1740   1  (autoclean)
iptable_mangle          2136   1
ipt_state                568  11
ipt_limit                888 114
ipt_tos                  472   0  (unused)
ip_conntrack_ftp        3792   1  (autoclean)
ip_nat_ftp              2832   0  (unused)
ip_nat_irc              2192   0  (unused)
iptable_nat            17752   2  [ip_nat_ftp ip_nat_irc]
ip_tables              12000  11  [ipt_TOS ipt_REJECT ipt_LOG iptable_filter iptable_mangle ipt_state ipt_limit ipt_tos iptable_nat]
ip_conntrack_irc        2800   1
ip_conntrack           18216   4  [ipt_state ip_conntrack_ftp ip_nat_ftp ip_nat_irc iptable_nat ip_conntrack_irc]
ppp_synctty             5376   0  (unused)
ppp_async               6656   1
autofs                 10420   0  (unused)
pppox                   1176   0  (unused)
ppp_generic            19228   3  [ppp_synctty ppp_async pppox]
slhc                    4976   0  [ppp_generic]
via-rhine              13552   1
crc32                   2880   0  [via-rhine]
3c59x                  26832   1


eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:224 errors:0 dropped:0 overruns:0 frame:0
          TX packets:495 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:36254 (35.4 Kb)  TX bytes:50827 (49.6 Kb)
          Interrupt:10 Base address:0xd000

eth1      Link encap:Ethernet  HWaddr 00:00:00:00:00:00 
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:441 errors:0 dropped:0 overruns:0 frame:0
          TX packets:322 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:46223 (45.1 Kb)  TX bytes:44943 (43.8 Kb)
          Interrupt:11 Base address:0xe800

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:222 errors:0 dropped:0 overruns:0 frame:0
          TX packets:222 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:17817 (17.3 Kb)  TX bytes:17817 (17.3 Kb)

ppp0      Link encap:Point-to-Point Protocol 
          inet addr:XXX.XXX.XXX.XXX  P-t-P:XXX.XXX.XXX.XXX  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:206 errors:0 dropped:0 overruns:0 frame:0
          TX packets:476 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:30573 (29.8 Kb)  TX bytes:39155 (38.2 Kb)

Back to top
View user's profile Send private message
Baldzius
Apprentice
Apprentice


Joined: 17 Mar 2003
Posts: 154
Location: Lithuania

PostPosted: Mon Jan 26, 2004 1:55 pm    Post subject: Reply with quote

Not sure , but you can try this:
iptables -t nat -A POSTROUTING -p ALL -o ppp0 -s 10.0.0.0/24 -j SNAT --to-source XXX.XXX.XXX.XXX
Back to top
View user's profile Send private message
JaquesStrap
n00b
n00b


Joined: 01 Jul 2003
Posts: 47

PostPosted: Mon Jan 26, 2004 8:02 pm    Post subject: I tried that, same thing... Reply with quote

I tried your suggestion and same error message.

Thanks for the reply.
-JS
Back to top
View user's profile Send private message
dsd
Developer
Developer


Joined: 30 Mar 2003
Posts: 2162
Location: nr London

PostPosted: Mon Jan 26, 2004 8:05 pm    Post subject: Reply with quote

hi,

recompile iptables under 2.4.22 and try again.
_________________
http://dev.gentoo.org/~dsd
Back to top
View user's profile Send private message
oegat
n00b
n00b


Joined: 12 Apr 2003
Posts: 41
Location: Sweden

PostPosted: Mon Jan 26, 2004 11:33 pm    Post subject: Reply with quote

dsd wrote:
hi,

recompile iptables under 2.4.22 and try again.


...and make sure the symlink /usr/src/linux points to the sources of the current kernel. I had the same problem and that little detail buggered me for a couple of days.
Back to top
View user's profile Send private message
triwebb1
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2003
Posts: 87

PostPosted: Tue Jan 27, 2004 1:06 am    Post subject: Reply with quote

If it doesn't owrk after you recompile it, try dropping the subnet mask. I am pretty sure it defaults to a /24 subnet anyway, and I've found that the "/" doesn't always work. I did think that iptables accepts it though.......
Back to top
View user's profile Send private message
triwebb1
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2003
Posts: 87

PostPosted: Tue Jan 27, 2004 1:06 am    Post subject: Reply with quote

If it doesn't work after you recompile it, try dropping the subnet mask. I am pretty sure it defaults to a /24 subnet anyway, and I've found that the "/" doesn't always work. I did think that iptables accepts it though.......
Back to top
View user's profile Send private message
Baldzius
Apprentice
Apprentice


Joined: 17 Mar 2003
Posts: 154
Location: Lithuania

PostPosted: Tue Jan 27, 2004 10:46 am    Post subject: Reply with quote

Try removing -s key:
iptables -t nat -A POSTROUTING -o ppp0 -j SNAT --to-source XXX.XXX.XXX.XXX
:)
Back to top
View user's profile Send private message
jmoeller
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2003
Posts: 114
Location: USA

PostPosted: Sat Jan 31, 2004 9:18 am    Post subject: Reply with quote

dsd wrote:
hi,

recompile iptables under 2.4.22 and try again.


Thanks for the tip, dsd. That's what worked for me.
_________________
Cogito sumere potum alterum.
Back to top
View user's profile Send private message
JaquesStrap
n00b
n00b


Joined: 01 Jul 2003
Posts: 47

PostPosted: Mon Feb 09, 2004 3:49 am    Post subject: Reply with quote

I never did manage to resolve this issue. I always get the "invalid option" error. I just tried with a 2.6.1 kernel and its the same thing.

Thanks for the suggestions all, looks like Ill be stuck with the older kernel for a while longer.
Back to top
View user's profile Send private message
masseya
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 2602
Location: Baltimore, MD

PostPosted: Mon Feb 09, 2004 5:41 pm    Post subject: Reply with quote

Moving from Networking and Security.

Please follow up to iptables invalid argument..

There are a great number of threads that are essentially dupes of this topic, so if you feel that something in this thread should go in the sticky thread, please re-post it there or provide a link back here. As always, please PM a moderator if you feel this thread is significantly different than any other thread and was inadvertently locked.

Thanks to nephros for pointing out the dupes.

nephros wrote:
These are a couple of dupes regarding the recent (and past) breakage of iptables with newer gentoo-sources (fix is to recompile iptables with correct "linux" symlink):

https://forums.gentoo.org/viewtopic.php?t=128430&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=123929&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=123385&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=121406&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=113410&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=101524&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=117746&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=110470&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=88111&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=79633&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=77221&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=74567&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=70546&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=52931&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=52020&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=47553&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=41032&highlight=iptables+invalid+argument
https://forums.gentoo.org/viewtopic.php?t=107331&highlight=iptables+invalid+argument

I am pretty sure there are even more. Oh when will they ever search... :roll:

_________________
if i never try anything, i never learn anything..
if i never take a risk, i stay where i am..
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum