f



iptables - "invalid argument" error ?

Hello everyone,

Why does this entry below result in a iptables error message?

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE

Results in "iptables: invalid argument"

And where might I find any documentation on the error messages for iptables?

Thanks

Luther

0
10/3/2003 7:02:44 PM
comp.os.linux.networking 15677 articles. 0 followers. Post Follow

4 Replies
426 Views

Similar Articles

[PageSpeed] 41

martin02 wrote:
> Why does this entry below result in a iptables error message?
> 
> iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
> 
> Results in "iptables: invalid argument"
> 
> And where might I find any documentation on the error messages for iptables?

One thing I can think of is that the nat table is not supported by Your
kernel. - In /var/log/messages, You might see a corresponding message.

Try lsmod and in Your kernel tree, see /net/ipv4/netfilter for the names
of the modules that You might need, especially all *nat* modules.

Then, You could try to insmod or modprobe these modules, where the ones
starting with "iptable_*" are the tables, "ipt_*" with capital letters
are Your targets and all others are matches.

This will also help with Your problem in the other thread You started.


Cheers, Jack.

-- 
----------------------------------------------------------------------
My personal reading of the string "MicroSoft" expands to "NanoWeak"...

0
not7727 (189)
10/4/2003 8:44:16 AM
On Fri, 03 Oct 2003 15:02:44 -0400, martin02 <lutherpFORTY@bellsouth.net>
fought his way into comp.os.linux.networking, paused briefly and let forth
upon the unsuspecting patrons the following literary masterpiece:
:
:Hello everyone,
:
:Why does this entry below result in a iptables error message?
:
:iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
:
:Results in "iptables: invalid argument"
:
:And where might I find any documentation on the error messages for iptables?
:
:Thanks
:
:Luther

I'm not sure if this will cure your problem but you may find specifying the
output device works. Obviously replace $EXTIF with the appropriate device
(eg. eth0).

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o $EXTIF -j MASQUERADE
-- 
gpuk
E-mail? Remove the BLOCK to reply
0
10/4/2003 5:58:03 PM
jack wrote:

> martin02 wrote:
>> Why does this entry below result in a iptables error message?
>> 
>> iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
>> 
>> Results in "iptables: invalid argument"
>> 
>> And where might I find any documentation on the error messages for
>> iptables?
> 
> One thing I can think of is that the nat table is not supported by Your
> kernel. - In /var/log/messages, You might see a corresponding message.
> 
> Try lsmod and in Your kernel tree, see /net/ipv4/netfilter for the names
> of the modules that You might need, especially all *nat* modules.
> 
> Then, You could try to insmod or modprobe these modules, where the ones
> starting with "iptable_*" are the tables, "ipt_*" with capital letters
> are Your targets and all others are matches.
> 
> This will also help with Your problem in the other thread You started.
> 
> 
> Cheers, Jack.
> 

Hi Jack,

Thanks again for trying to help out.

I am starting to think that the version of iptables I have installed is
important. I am running version 1.2.7a

No errors recorded in the log.  These are the only references to iptables in
the log at the approx. time period of the errors.

Oct  5 14:29:45 lutherp11 kernel: device ppp0 entered promiscuous mode
Oct  5 14:46:09 lutherp11 kernel: ip_tables: (C) 2000-2002 Netfilter core
team
Oct  5 14:46:09 lutherp11 kernel: ip_conntrack version 2.1 (5887 buckets,
47096 max) - 300 bytes per conntrack

With verbose turned on I get the following if that is of any help:
"iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
--verbose"

MASQUERADE  all opt -- in * out eth0  192.168.1.0/24  -> 0.0.0.0/0
iptables: Invalid argument

lsmod shows:
Module                  Size  Used by    Not tainted
ipt_MASQUERADE          1272   0  (autoclean)
iptable_nat            15224   0  (autoclean) [ipt_MASQUERADE]
ip_conntrack           18400   1  (autoclean) [ipt_MASQUERADE iptable_nat]
ip_tables              11672   4  [ipt_MASQUERADE iptable_nat]
I don't see any other references to ip* listed

I haven't been able to find "/net/ipv4/netfilter" yet.  Probably because I
am running Mandi distro or perhaps I haven't gotten iptables running at
boot.  The closest thing I can find is /proc/net and /proc/sys/net neither
of which pan out to a "netfiter". So will have to keep looking for the list
you mention.

I am not far from believing that this is a syntax error in iptables v1.2.7a
in the POSTROUTING/MASQ/SNAT section of the complile of iptables itself.

Luther

0
10/5/2003 7:32:07 PM
gpuk wrote:

> On Fri, 03 Oct 2003 15:02:44 -0400, martin02 <lutherpFORTY@bellsouth.net>
> fought his way into comp.os.linux.networking, paused briefly and let forth
> upon the unsuspecting patrons the following literary masterpiece:
> :
> :Hello everyone,
> :
> :Why does this entry below result in a iptables error message?
> :
> :iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
> :
> :Results in "iptables: invalid argument"
> :
> :And where might I find any documentation on the error messages for
> :iptables?
> :
> :Thanks
> :
> :Luther
> 
> I'm not sure if this will cure your problem but you may find specifying
> the output device works. Obviously replace $EXTIF with the appropriate
> device (eg. eth0).
> 
> iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o $EXTIF -j MASQUERADE

Nope.  Still gives the same error.

"iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0  -j MASQUERADE"
I also tried:
"iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE"
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE"

Trying the command in 'verbose mode' gives slightly more information:

iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
--verbose
MASQUERADE  all opt -- in * out eth0  192.168.1.0/24  -> 0.0.0.0/0
iptables: Invalid argument

I still have no clue what it is complaining about.

Luther

0
10/5/2003 8:47:05 PM
Reply:

Similar Artilces:

[iptables] iptables: invalid argument
Hi all, I'm using a Linux-Box with Debian stable (Woody) with kernel 2.4.5 (vanilla, from kernel.org). After upgrading to kernel 2.4.25, I got "iptables: invalid argument" when calling "iptables -t nat -A OUTPUT ....". Same problem exists on an older SuSE Linux 7.1 According to the netfilter.org-FAQ, I recompiled the user-space "iptables"-binary including libraries, but it didn't work out for me :( strace tells me that the binary is using the correct recompiled libraries, and stops after calling setsockopt returning "-1 EINVAL (Invalid argument)" Any ideas? Thanx in advance, Martin 'Funny' Heise Martin 'Funny' Heise wrote: > Hi all, > > I'm using a Linux-Box with Debian stable (Woody) with kernel 2.4.5 > (vanilla, from kernel.org). After upgrading to kernel 2.4.25, I got > "iptables: invalid argument" when calling "iptables -t nat -A OUTPUT > ...". Same problem exists on an older SuSE Linux 7.1 > > According to the netfilter.org-FAQ, I recompiled the user-space > "iptables"-binary including libraries, but it didn't work out for me :( > > strace tells me that the binary is using the correct recompiled > libraries, and stops after calling setsockopt returning "-1 EINVAL > (Invalid argument)" > > Any ideas? > > Thanx in advance, > Martin 'Funny' Heise modprobe iptable_nat Andrey Asadchev wrote: ...

Invalid argument error in IE
Hi, I have created two javascript classes in the following way. //Script tag starts here function ClassA(textBoxID, objB) { this.textBox = document.getElementById(textBoxID); this.objB = objB; //some other methods } function ClassB() { this.propertyA = "some value"; //some other methods } var objA = null, objB = null; function body_onLoad() { objB = new ClassB(); objA = new ClassA("aTextBoxID", objB); } //Script tag ends here This approach runs as expected in Firefox but in Internet Explorer, I get a script error "Invalid Argument" at a line numb...

poll error in linux OS
Hi, Currently I did some porting work from solaris OS to linux OS then I ran into a very curious problem: See below codes. the poll works pretty well in Solaris OS, but it "fired Poll Error with client .. " error in linux OS. Is it possible that this error occured due to the wrong use of poll in linux? Thanks much for your any useful information! /* poll clients */ pollReady = poll(clientfdsPtr,MAX_CLIENTS,clientTimeOut); if (pollReady > 0) { for (int loopCnt = 0; loopCnt < MAX_CLIENTS; loopCnt++) { DEBUG((...

Invalid Argument error on boot
I have a SunFire V210 which is spitting out a "Invalid Argument" error during boot. The error occurs immediately following the "normal" error messages you get when loading the volume manager on Solaris 9: WARNING: forceload of misc/md_trans failed WARNING: forceload of misc/md_raid failed WARNING: forceload of misc/md_hotspares failed Invalid Argument: Operation failed I had recently made a bunch of changes to the security configuration of the system. My guess is I fat-fingered something and didn't catch it. Any tips for finding out exactly where this is occuring?...

Linux BSP
We are developing a product using Linux BSP on a ColdFire 5475. I can send messages to specific IP addresses over UDP; however, when I attempt to send broadcast messages, I get the following error: "Network is unreachable" I have seen the same problem when I run our software on the "ColdFire Lite Development Kit" board from Freescale. Except for having a broadcast thread ( the udp_inquire_thread ), I have the same code working correctly on my Linux PC ( running Fedora Core 4). Using /sbin/ifconfig I have checked both my Linux PC and the developme...

[News] Making Linux More Like OS X and OS X More Like Linux
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mac OS X - Highly Customized Linux ,----[ Quote ] | Few players in the Linux arena creates their Linux distro to look like Mac OS | X or Windows.... | | Here I'm going to list some distro which looks like Mac OS. `---- http://linuxtreat.blogspot.com/2008/07/mac-os-x-highly-customized-linux.html A Linux User's Guide to Mac ,----[ Quote ] | Take a deep breath and repeat after me: A computer is just a tool. It is only | so good as it serves to make life better for users. A "better" life is | obviously not the same thing for everyone. For me, it means making my Mac | more like Linux, as I began to discuss in my last article. `---- http://www.ofb.biz/safari/article/474.html Yesterday: Ubuntu: Challenge the Mac ,----[ Quote ] | Normally I would just provide a Diigo link to this if it weren’t something | I’ve been saying a lot in talks. Over at InformationWeek, Serdar Yegulaip was | a piece called “Shuttleworth’s Ubuntu Ambitions: Challenge the Mac”. He | quotes Mark Shuttleworth saying in a Datamation article: | |     … our goal, very simply, is to make sure the Free software ecosystem can |     deliver a Mac OS-like experience, or an experience that will compete with |     the Mac OS. | | I think this is exactly right. It’s time to look past Windows, even with its | huge installed base, as any sort of “gold standard” (as Mark calls it), | especially for user interface. ...

mmap() ---- Invalid argument(EINVAL) error ..?
Hi I am using mmap() like this my intension is to allocate (mSize)memory with no memory protection and without file descriptor like this: pBase =(Ptr) mmap(0, mSize,PROT_NONE,MAP_ANONYMOUS,0,0); but I am getting an error Invalid argument(EINVAL). Can anybody give the correct way of doing this? I am using gcc in SOLARIS environment. Thanks, Vinu "Vinu" <vinuwarrier@yahoo.com> writes: >Hi > I am using mmap() like this my intension is to allocate (mSize)memory >with no memory protection and without file descriptor like this: > pBase =(Ptr) mmap(0, mSize,PROT_N...

ioctl program giving invalid argument error
I am trying to successfully run the following program that I downloaded from the net.I have commented some part.The program compiles and executable is formed fine.But when I give the command line arguments on giving -s option I get the error of invalid argument :- #include <stdio.h> #include <sys/param.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <sys/ioctl.h> #include <errno.h> #include <netdb.h> //#include "nlist.h" #include <net/if.h> #include <netinet/if_ether.h> e...

access2007 create table error
I've got a 2nd MDB with a table (tblPersonalInfo) and I'm trying to create a linked table strsql is the path to that mdb this works Set db = CurrentDb Set tbl = db.CreateTableDef("tblPersonalInfo." & lngEmpCode, _ dbHiddenObject, _ "tblPersonalInfo", _ strSql) but if I use, dbAttachedODBC, I get an error, invalid argument yet if I use the link table manager to link to the table and I display its attribute property it is set...

Error 3001: Invalid Argument
I Googled around a little. Seems like the consensus was that it's something to to with a corrupted DB. But I suspect it's not in my case. The query in question runs fine when I spoon-feed it manually. It's going south when I load it in code. I've written all the parms to Debug.Print and then pasted them into a manual invocation of the query one-by-one and it worked also. I'm dead in the water on this one. Anybody been here? -- PeteCresswell Per (Pete Cresswell): >I'm dead in the water on this one. Fixed it. Didn't find it....but I fixed it.... Delet...

unknown option error for network arguments in netra t200
Hello unixies I have upgraded my OBP flash and still i'm facing this unknown option error for network arguments, my hardware is the pretty old though. its netra T200, is that any way set this arguments? Thanks in adv BM wrote: > Hello unixies > > I have upgraded my OBP flash and still i'm facing this unknown option > error for network arguments, my hardware is the pretty old though. > > its netra T200, is that any way set this arguments? > > Thanks in adv Since this seems to be your one and only post to this newsgroup, perhaps you should explain your pr...

error connecting to xxx.xxx.xxx:139 (Invalid argument)
If I run the command, "smbclient SERVERNAME <password> -U <userid>" I am having a problem to connect to some of the Windows 2000 servers that are configured as clusters. I could connect to one of them but not to others. I get answer as following: added interface ip=xxx.xxx.xxx.xxx bcast=xxx.xxx.xxx.255 nmask=255.255.255.0 error connecting to xxx.xxx.xxx.xxx:139 (Invalid argument) Error connecting to xxx.xxx.x.xx (Invalid argument) Connection to <SERVERNAME> failed Is this something to do with enabling NetBIOS over TCP/IP? How can I solve this problem...

file read / close / write fluke error invalid argument
I have a program I wrap in a starpack and is used by others on a windows platform. When the program runs it cleans out old items from a file. To do this it reads the file into memory, then closes the file, then re-opens the file for writing. On my system I have done this countless times without any errors. When an associate used the program it functioned properly many times but eventually it threw an error that the open command to write the file was called with an invalid argument. I am presuming that this error is somewhat of a glitch cause by the open/close/open sequence, but ...

Any Documentaion about How Linux Networking IP stack looklike between Linux PC (single NIC card) and Router with multiple Network interfaces (LAN and WAN)?
Any Documenttaion about How Linux IP Networking stack looklike bwteen Linux PC (single NIC card) and Router with multiple Network interfaces running on Linux (LAN and WAN)?. appreciated for links or some documentation. Thanks. ...

termios.tcgetattr(fd) error: (22, 'Invalid argument')
On my box (Fedora Core4, Python 2.4.1) I am getting following error: >>> import termios, sys >>> fd = sys.stdin.fileno() >>> oldSettings = termios.tcgetattr(fd) Traceback (innermost last): File "<stdin>", line 1, in ? error: (22, 'Invalid argument') Thanks for your comments. Petr Jakes To provide some feedback: As Grant Edwards posted in this list, I was running my code inside of IDE that replaces sys.stdin with some other. While running the program from a shell prompt, everything goes fine. Petr Jakes Petr Jakes wrote: >To provi...

makemap: error opening type hash map access: Invalid argument
i'm installing a new machine, and i ran into something that i haven't seen before, any help and pointers appreciated; let me know if more info is needed OS: linux sendmail-8.14.3 and db-4.8.24 (both compiled from source) # makemap hash access < access access.db: Invalid type 5 specified makemap: error opening type hash map access: Invalid argument # makemap -l hash btree # ldd /usr/local/sbin/makemap linux-gate.so.1 => (0xb77b8000) libdb-4.8.so => /usr/local/lib/libdb-4.8.so (0xb7644000) libresolv.so.2 => /lib/libresolv.s...

Mac OSX -> linux x11Forwarding struggles, invalid name errors?
Greetings, I'm having a heck of a time getting ssh X11Forwarding working from a mac OS X 10.3.9 box to any Linux ssh server. I haven't tried other servers as I don't have access to others. I've done a lot of X11 forwarding in the past (but never using the Mac client), and this issue seems to be different than any I've previously experienced. I suspect these "invalid name was supplied" errors may be related (see -v output below). This seems to happen whether sshing by IP or by hostname. I'd also welcome what the best way to upgrade an openssh client on ...

Creating Posix message queue with attribute get error (invalid argument)
Why not Following code always get "Invalid argument" error? $ ./a.out /tmp.333 Wrong! : Invalid argument #include <mqueue.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/stat.h> #include <iostream> using namespace std; #define FILE_MODE S_IRUSR|S_IWUSR struct mq_attr attr; int main(int argc, char** argv){ int c, flags; mqd_t mqd; flags = O_RDWR|O_CREAT; if( argc != 2){ printf("usage: mqcreate <name>\n"); return -1; } attr.mq_maxmsg = 512; attr.mq_msgsize = 512; mqd = mq_open( argv[argc -1 ], flags, FILE_MODE, &attr); if(mqd < 0){ perror("Wrong!\n"); return -1; } mq_close(mqd); exit(0); } Hill wrote: > Why not Following code always get "Invalid argument" error? > > $ ./a.out /tmp.333 > > Wrong! > : Invalid argument > Hi Hill! It's common problem when working with POSIX MQ. Your system disallows you to create MQ containing 512 messages, since system-wide limit is 10 by default. You can solve your problem by changing hard limit as follows: krivenok@olimpico_work 10:44:27 /tmp $ g++ -lrt -Wall mq.cpp mq.cpp: In function 'int main(int, char**)': mq.cpp:16: warning: unused variable 'c' krivenok@olimpico_work 10:44:37 /tmp $ ./a.out /tmp.333 Wrong! : Invalid argument krive...

IBM AIX RISC System/6000 Error: 22: Invalid argument
Hi Folks.. I'm getting the following message when trying to open my Oracle database after copying from cooked to raw filesystems.. SQL> @create_raw_IBM_db.sql ORACLE instance started. Total System Global Area 202868072 bytes Fixed Size 742760 bytes Variable Size 167772160 bytes Database Buffers 33554432 bytes Redo Buffers 798720 bytes CREATE CONTROLFILE REUSE DATABASE "IBM" NORESETLOGS NOARCHIVELOG * ERROR at line 1: ORA-01503: CREATE CONTROLFILE failed ORA-01565: error in identifying file '/dev/rIBM_system01...

Free Download Ebook for linux networking guide | http://freepdf-ebook.blogspot.com/2007/12/linux-network-admin-guide.html
i have linux networking guide, their format is pdf, you can download it for free http://freepdf-ebook.blogspot.com/2007/12/linux-network-admin-guide.html Tony Andreas wrote: > i have linux networking guide, their format is pdf, you can download > it for free > http://freepdf-ebook.blogspot.com/2007/12/linux-network-admin-guide.html i have problems resolving the domain name of this link: http://www.mybook.000webhost.info/Linux%20Network%20Admin%20Guide.pdf goarilla <"kevin DOT paulus AT skynet DOT be"> wrote: > Tony Andreas wrote: >> i have linux networking guide, their format is pdf, you can download >> it for free >> http://freepdf-ebook.blogspot.com/2007/12/linux-network-admin-guide.html > > i have problems resolving the domain name of this link: > http://www.mybook.000webhost.info/Linux%20Network%20Admin%20Guide.pdf What link is that? i.e. which one on the Home Page? There are over 30 of them. mybook.000webhost.info resolves to 64.235.54.104 The link you gave opens KPDF for me - I didn't look at its contents. Doug. Doug Laidlaw wrote: > goarilla <"kevin DOT paulus AT skynet DOT be"> wrote: > >> Tony Andreas wrote: >>> i have linux networking guide, their format is pdf, you can download >>> it for free >>> http://freepdf-ebook.blogspot.com/2007/12/linux-network-admin-guide.html >> i have problems resolving the domain name of this link: >>...

I want to study linux network but I have not a network
HI, I am using debian 3.0 as my linux PC and I want to study the linux network administartion. When I only have one pc, is it possible for me to study it on this only one PC? Is any emulation that can be done to construct a virtual network within my PC? Any help appreciated! Chen On Tue, 02 Nov 2004 19:06:40 +0800, Chen Bin wrote: > HI, > > I am using debian 3.0 as my linux PC and I want to study the linux > network administartion. When I only have one pc, is it possible for me > to study it on this only one PC? > > Is any emulation that can be done to construct a virtual network within > my PC? You can use Vmware (www.vmware.com), but it's quite expensive. The workstation edition costs $189. But you can get a 30 day fully functioning trial version. -- Rolf Arne Schulze Trans-atlantic weightloss challenge: http://tawlc.net/ Personal weblog: http://roffe.ronningveien.net/ In comp.os.linux.networking Chen Bin <binch@mobilesoft.com.cn>: > HI, > I am using debian 3.0 as my linux PC and I want to study the linux > network administartion. When I only have one pc, is it possible for me > to study it on this only one PC? > Is any emulation that can be done to construct a virtual network within > my PC? You can do almost anything just over loop-back, like "ssh localhost" no need for any emulation, you already have one. -- Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94) mail: echo zvpunry@urvz...

Link Error: invalid object error
Hi, I tried to build my project on MAC OS X 10.3 (7B39) compilation was fine but linker complains: Invalid object code /usr/lib/libiconv.2.dylib what does it mean? and is it possible to workaround it somehow? thanks Dmitry Markman In article <BB66E059.680E%dima@concord.org>, Dmitry Markman <dima@concord.org> wrote: >Hi, I tried to build my project >on MAC OS X 10.3 (7B39) I don't have any idea what this is, perhaps you meant to write 10.2 since you'd be breaking a contract if you mentioned any NDA stuff. >compilation was fine >but ...

Networking Questions I have for multiple OS Networking
I have some questions that I am hoping someone can help me with. I have plans to network 7 PC's together with different OS as follows. Windows XP Prof Windows XP Home Windows 2000 Windows Me Windows 98 SE Windows 95B Linux Red Hat 8.0 My 7 computers have their OS installed as well as 10/100mbps NICs, which will all connect to my 10/100 Switch. (1.) Does anyone know of any incompatibilities I will have or problems that I can avoid when setting up this network of multiple operating systems? (2.) Is there any patches I will need for specific OS to network with the...

WARNING: Network Down / Error Writing to network
Just installed Informix 7.31UC4 on Solaris and when running onmonitor I get WARNING: Network Down Any idea how to get around this problem. Help would be most appreciated. ...

PPPD error: Couldn't attach to interface unit 0: Invalid Argument
Hi All, I have written a PPP application that runs ppp on the slave side of a pseudo terminal. I have multilink enabled in my PPP options file. When i run the application i am getting the following error on a Linux PC Couldn't attach to interface unit 0: Invalid Argument Log says, the MP bundle creation is is successful after that i am getting this error. What does this error mean in Linux PPP Generic module ?. Also, i have to do some processing on the packets received on the slave side of the pseudo terminal. If i disable the "sync" option from my options file, the packets received are stuffed withe 0x7E 0x7D flags. What i observe is, only the LCP packets are stuffed with 0x7D flag, and the IPCP packets are not stuffed..?Is there any problem with my application or where can i see the code in Linux Kernel which does this byte stuffing..? Thanks, Vanitha vanitha@agilis.st.com.sg (Vanitha) writes: > Also, i have to do some processing on the packets received on the > slave side of the pseudo terminal. If i disable the "sync" option from > my options file, the packets received are stuffed withe 0x7E 0x7D > flags. What i observe is, only the LCP packets are stuffed with 0x7D > flag, and the IPCP packets are not stuffed..?Is there any problem with > my application or where can i see the code in Linux Kernel which does > this byte stuffing..? I think you're looking at the effect of the ACCM. Th...