Getting "SIOCADDRT: Invalid argument" with 'route add' ...?

Getting "SIOCADDRT: Invalid argument" with 'route add' ...?

Post by Alex Tayl » Fri, 11 Jun 1999 04:00:00



I'm running a somewhat-upgraded version of Debian 2.1 with
kernel 2.2.6, and I've noticed this worrying message in my
startup sequence.

After some investigation, I've discovered it's occurring
during /etc/init.d/network, specifically, the "route"
command.

This is my /etc/init.d/network file:

        #! /bin/sh
        ifconfig lo 127.0.0.1
        route add -net 127.0.0.0
        ifconfig eth0 192.168.1.2
        route add -net 192.168.1.0 dev eth0

..and each (yes, I get it twice) of the "route add" lines
produces:

        SIOCADDRT: Invalid argument

I've tried issuing the commands manually as well, and
get the same thing.  However, the routing table
does appear to be being updated correctly.  I can
ping loopback, and my computer works fine on my local
mini-LAN via eth0.

This happens if just the loopback is used, as well -- i.e.,
if I remove the last two lines.  (Actually, this
started before I even added the eth0 device to my PC.)

I know this has been happening ever since I upgraded my
kernel to 2.2.6 -- I'm not sure if it happened before, but
I don't think it did...

It doesn't seem to be a serious error, but it worries me,
and I'd like to fix it.

If anyone could shed some light on this, I'd appreciate it.
Thanks...

-----------------------------------------------------------------
 Alex Taylor                  BA - CIS - University of Guelph

-----------------------------------------------------------------

 
 
 

Getting "SIOCADDRT: Invalid argument" with 'route add' ...?

Post by Charles Wilki » Sat, 12 Jun 1999 04:00:00




>I'm running a somewhat-upgraded version of Debian 2.1 with
>kernel 2.2.6, and I've noticed this worrying message in my
>startup sequence.

>After some investigation, I've discovered it's occurring
>during /etc/init.d/network, specifically, the "route"
>command.

>This is my /etc/init.d/network file:

>    #! /bin/sh
>    ifconfig lo 127.0.0.1
>    route add -net 127.0.0.0
>    ifconfig eth0 192.168.1.2
>    route add -net 192.168.1.0 dev eth0

>..and each (yes, I get it twice) of the "route add" lines
>produces:

>    SIOCADDRT: Invalid argument

>I've tried issuing the commands manually as well, and
>get the same thing.  However, the routing table
>does appear to be being updated correctly.  I can
>ping loopback, and my computer works fine on my local
>mini-LAN via eth0.

>This happens if just the loopback is used, as well -- i.e.,
>if I remove the last two lines.  (Actually, this
>started before I even added the eth0 device to my PC.)

>I know this has been happening ever since I upgraded my
>kernel to 2.2.6 -- I'm not sure if it happened before, but
>I don't think it did...

>It doesn't seem to be a serious error, but it worries me,
>and I'd like to fix it.

>If anyone could shed some light on this, I'd appreciate it.
>Thanks...

>-----------------------------------------------------------------
> Alex Taylor                  BA - CIS - University of Guelph

>-----------------------------------------------------------------

Hi, I get this error every time I change IP addresses - not often -
but about 4 times now. There is a corruption in a config file
somewhere.

Delete your network bindings / configuration and rebuild it from
scratch. You can do this in X or linuxconf.

Fixes it for me every time. 5.1 was hell with this problem, 5.2 was
much better. 6.0 is too new to tell.

Charles

Charles Wilkins  CNE / MCP / A+
Network Design Consultant
Practical Computer Solutions
http://www.pcscs.com
609-321-1530
609-321-0840 - fax
--

 
 
 

Getting "SIOCADDRT: Invalid argument" with 'route add' ...?

Post by Brian Greenfie » Tue, 15 Jun 1999 04:00:00


[posted to cols only. It's a setup issue]



>I'm running a somewhat-upgraded version of Debian 2.1 with
>kernel 2.2.6, and I've noticed this worrying message in my
>startup sequence.

>After some investigation, I've discovered it's occurring
>during /etc/init.d/network, specifically, the "route"
>command.

>This is my /etc/init.d/network file:

>    #! /bin/sh
>    ifconfig lo 127.0.0.1
>    route add -net 127.0.0.0
>    ifconfig eth0 192.168.1.2
>    route add -net 192.168.1.0 dev eth0

>..and each (yes, I get it twice) of the "route add" lines
>produces:

>    SIOCADDRT: Invalid argument

You need to add a netmask to each of the route commands.
Newer kernels no longer have a default.

Although it's not a problem you've encountered (yet?),
previous kernels didn't mind not being told which interface
each route applied to, so add a dev XXX to each.

Something like:

  route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
  route add -net 192.168.1.0 netmask 255.255.0.0 dev eth0

should work. The netmask for 127.0.0.0 does work (here, at
least), but I'm not sure if it's *absolutely* correct.

I'm not sure if it's needed, but I've also got a netmask &
broadcast with 'ifconfig eth0 ...'

HTH
--
You're reading this in a newsgroup because that's where I posted it.
That's where I'd like to read your reply too.   DON'T MAIL AND POST!

But, if you really want to reply by email, my reply-to *IS* valid ;)

 
 
 

1. Getting "SIOCADDRT: Invalid argument" with 'route add' ...?


I get the same error on my Debian box, though I never bothered trying to
isolate what was causing it.  Thanks for doing my work for me. :)

Starting with the 2.2.x kernels, linux automatically sets up routes for
devices brought up with "ifconfig", so you no longer need the "route"
invocations in your startup files unless you're doing something unusual
(in which case you'll want to use "route del ..." to get rid of the
default routes, or perhaps there's a switch for ifconfig...).

In any case, try commenting out the "route" lines by preceding them
with a "#", and see if that gets rid of the error messages.

-Kevin

2. Changing to simgle-user mode

3. routing trouble "SIOCADDRT: Invalid argument "

4. Linux and webcam

5. What does "SIOCADDRT: Invalid Argument" mean?

6. How to build your own driver?

7. HELP! "SIOCADDRT: Invalid Argument"

8. SEGS placement in executable files

9. "SIOCADDRT: Invalid argument"

10. new filesystem problems: "fdisk: can't write fdisk partition table: Invalid argument"

11. zftape 1.06: "tar: can't write to /dev/zqft0 : Invalid argument"

12. atalkd won't load, "Invalid argument" (YDL/CS 1.2 on Gossamer)

13. Local forwarding with "iptables" gives "invalid arguments"