SIOCADDRT: No such device when setting lo

Discussion in 'Linux Networking' started by Joel Kreager, Feb 13, 2005.

  1. Joel Kreager

    Joel Kreager Guest

    I have been trying to set up a local network to bridge through my dsl
    connected computer. I am running redhat 9 but with a 2.6.10 kernel on
    my main computer. Since I could not get any ping to return from my
    second computer when pinging first, (I tried many things), I turned
    off all the network setup /etc/sysconfig/network to off to do
    everything by hand. (An emergency linux disk did return pings from
    the second computer, but redhat 9 did not). When I run:

    /sbin/ifconfig lo 127.0.0.1

    I get:

    [veryfine:~]# /sbin/ifconfig lo
    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:1 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:29 (29.0 b) TX bytes:29 (29.0 b)

    But when I run:

    /sbin/route add 127.0.0.1

    I get:

    SIOCADDRT: No such device

    I can run:

    /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 gw 127.0.0.1

    successfully, but I can't ping localhost.

    Don't know if this is the reason I can't get a return from the redhat
    host when I ping from my second computer, but I am suspicious.
     
    Joel Kreager, Feb 13, 2005
    #1
    1. Advertisements

  2. Since you didn't give a device name, it is using "" for the name.
    Read the man pages for ifconfig and route. Then try these steps in turn:

    /sbin/ifconfig lo 127.0.0.1

    # These are just for information:
    /sbin/ifconfig lo
    /sbin/route

    ping 127.0.0.1 # Works because ifconfig sets a subnet route.
    If you have deleted the route that ifconfig provided, the command
    to put it back is

    /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 dev lo

    You certainly don't need a gatway! But you do need to tell it which
    interface the route applies to...
     
    Floyd L. Davidson, Feb 14, 2005
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.