SIOCADDRT: No device found

ManojMathew
ManojMathew used Ask the Experts™
on
Hi
I have installed linux 7.2 server and initially i had configured it to be a dhcp client. Now when i try to give a static IP address to it and try to restart the network it gives the following error
Setting network parameters:                 [OK]
Bringing up  interface lo:                  [OK]
Bringing up interface eth0:                 [OK]
SIOCADDRT: No device found

Can anyone suggest me any way of getting rid of this error
I can't acces my network due to this.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2005

Commented:
I suspect that you've accidentally created more than one network config. What do you see if you do:

ls /etc/sysconfig/network-scripts/ifcfg-*

Author

Commented:
hi jlevie
well when i do
ls /etc/sysconfig/network-scripts/ifcfg-*
I get the following files
ifcfg-eth0
ifcfg-irlan0.OLD
ifcfg-lo

are these not necessary...
pls let me know

Author

Commented:
hi jlevie
well when i do
ls /etc/sysconfig/network-scripts/ifcfg-*
I get the following files
ifcfg-eth0
ifcfg-irlan0.OLD
ifcfg-lo

are these not necessary...
pls let me know

Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Author

Commented:
hi jlevie
well when i do
ls /etc/sysconfig/network-scripts/ifcfg-*
I get the following files
ifcfg-eth0
ifcfg-irlan0.OLD
ifcfg-lo

are these not necessary...
pls let me know

Top Expert 2005

Commented:
You should be able to delete ifcfg-irlan0.OLD as it isn't being  used. The other two need to remain.

Could I see the contents of /etc/sysconfig/network & /etc/sysconfig/network-scripts/ifcfg-eth0
I think you don't have the proper driver installed for your lan card. Your lan card should come with a driver diskette. Browse the README file to know which driver you should use. To install a lan card:

> insmod driver_name

That should do it.

Author

Commented:
Hi the  /etc/sysconfig/network file is as follows
#! /bin/bash
#
# network       Bring up/down networking
#
# chkconfig: 2345 10 90
# description: Activates/Deactivates all network interfaces configured to \
#              start at boot time.
# probe: true

# Source function library.
. /etc/init.d/functions

if [ ! -f /etc/sysconfig/network ]; then
    exit 0
fi

. /etc/sysconfig/network

if [ -f /etc/sysconfig/pcmcia ]; then
      . /etc/sysconfig/pcmcia
fi


# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

[ -x /sbin/ifconfig ] || exit 0

# Even if IPX is configured, without the utilities we can't do much
[ ! -x /sbin/ipx_internal_net -o ! -x /sbin/ipx_configure ] && IPX=

# If IPv6 is explicitly configured, make sure it's available.
if [ "$NETWORKING_IPV6" = "yes" ]; then
      alias=`modprobe -c | awk '/^alias net-pf-10 / { print $3 }'`
      if [ "$alias" != "ipv6" -a ! -f /proc/net/if_inet6 ]; then
            echo "alias net-pf-10 ipv6" >> /etc/modules.conf
      fi
fi

CWD=`pwd`
cd /etc/sysconfig/network-scripts

. network-functions

# find all the interfaces besides loopback.
# ignore aliases, alternative configurations, and editor backup files
interfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \
          LANG=C egrep -v '(~|\.bak)$' | \
          LANG=C egrep -v 'ifcfg-cipcb[0-9]+$' | \
            LANG=C egrep 'ifcfg-[a-z0-9]+$' | \
            sed 's/^ifcfg-//g'`

# See how we were called.
case "$1" in
  start)
      # IPv6 hook (pre IPv4 start)
      if [ "$NETWORKING_IPV6" = "yes" ]; then
            if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then
                  /etc/sysconfig/network-scripts/init.ipv6-global start pre
            fi
      fi
 
        action $"Setting network parameters: " sysctl -e -p /etc/sysctl.conf

      action $"Bringing up interface lo: " ./ifup ifcfg-lo

      case "$IPX" in
        yes|true)
          /sbin/ipx_configure --auto_primary=$IPXAUTOPRIMARY \
                           --auto_interface=$IPXAUTOFRAME
          if [ "$IPXINTERNALNETNUM" != "0" ]; then
             /sbin/ipx_internal_net add $IPXINTERNALNETNUM $IPXINTERNALNODENUM
          fi
          ;;
      esac

      oldhotplug=`sysctl kernel.hotplug  2>/dev/null| awk '{ print $3 }' 2>/dev/null`
      sysctl -w kernel.hotplug="/bin/true" > /dev/null 2>&1

      for i in $interfaces; do
            if [ "${i##eth}" != "$i" ] && ! is_available $i ; then
                  continue
            fi
            if LANG=C egrep -L "^ONBOOT=\"?[Nn][Oo]\"?" ifcfg-$i > /dev/null ; then
                  continue
            fi
            # If we're in confirmation mode, get user confirmation
            [ -n "$CONFIRM" ]  &&
                  {
                      confirm $i
                      case $? in
                        0)
                            :
                        ;;
                        2)
                            CONFIRM=
                        ;;
                        *)
                            continue
                        ;;
                      esac
            }

            action $"Bringing up interface $i: " ./ifup $i boot
      done
      
      # add cipe here.
      cipeinterfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \
          LANG=C egrep -v '(~|\.bak)$' | \
          LANG=C egrep 'ifcfg-cipcb[0-9]+$' | \
            sed 's/^ifcfg-//g'`
      for i in $cipeinterfaces ; do
            if ! LANG=C egrep -L "^ONBOOT=\"?[Nn][Oo]\"?" ifcfg-$i >/dev/null 2>&1 ; then
            # If we're in confirmation mode, get user confirmation
            [ -n "$CONFIRM" ]  &&
            {
                  confirm $i
                  case $? in
                        0)
                            :
                        ;;
                        2)
                            CONFIRM=
                        ;;
                        *)
                            continue
                        ;;
                  esac
            }
            action $"Bringing up interface $i: " ./ifup $i boot
          fi
        done

      sysctl -w kernel.hotplug=$oldhotplug > /dev/null 2>&1
      
      # Add non interface-specific static-routes.
      if [ -f /etc/sysconfig/static-routes ]; then
         grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do
              /sbin/route add -$args
         done
      fi    

       # IPv6 hook (post IPv4 start)
       if [ "$NETWORKING_IPV6" = "yes" ]; then
             if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then
                   /etc/sysconfig/network-scripts/init.ipv6-global start post
             fi
       fi
 
        touch /var/lock/subsys/network
        ;;
  stop)
        # If this is a final shutdown/halt, check for network FS,
      # and unmount them even if the user didn't turn on netfs
      
      if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
            NFSMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^nfs$/ ) print $2}'`
            SMBMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^smbfs$/ ) print $2}'`
            NCPMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^ncpfs$/ ) print $2}'`
            if [ -n "$NFSMTAB" -o -n "$SMBMTAB" -o -n "$NCPMTAB" ] ; then
                  /etc/init.d/netfs stop
            fi
      fi
      
       # IPv6 hook (pre IPv4 stop)
       if [ "$NETWORKING_IPV6" = "yes" ]; then
             if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then
                   /etc/sysconfig/network-scripts/init.ipv6-global stop pre
             fi
       fi
 
      for i in $interfaces ; do
              if LC_ALL= LANG= ifconfig $i 2>/dev/null | grep -q " UP " >/dev/null 2>&1 ; then
               action $"Shutting down interface $i: " ./ifdown $i boot
            fi
      done
      case "$IPX" in
        yes|true)
          if [ "$IPXINTERNALNETNUM" != "0" ]; then
             /sbin/ipx_internal_net del
          fi
          ;;
      esac
      ./ifdown ifcfg-lo
      if [ -d /proc/sys/net/ipv4 ]; then
        if [ -f /proc/sys/net/ipv4/ip_forward ]; then
            if [ `cat /proc/sys/net/ipv4/ip_forward` != 0 ]; then
                  action $"Disabling IPv4 packet forwarding: " sysctl -w net.ipv4.ip_forward=0
            fi
        fi
        if [ -f /proc/sys/net/ipv4/ip_always_defrag ]; then
              if [ `cat /proc/sys/net/ipv4/ip_always_defrag` != 0 ]; then
                    action $"Disabling IPv4 automatic defragmentation: " sysctl -w net.ipv4.ip_always_defrag=0
            fi
        fi
      fi

      # IPv6 hook (post IPv4 stop)
      if [ "$NETWORKING_IPV6" = "yes" ]; then
            if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then
                  /etc/sysconfig/network-scripts/init.ipv6-global stop post
            fi
      fi
      
        rm -f /var/lock/subsys/network
        ;;
  status)
      echo $"Configured devices:"
      echo lo $interfaces

      if [ -x /sbin/linuxconf ] ; then
            eval `/sbin/linuxconf --hint netdev`
            echo $"Devices that are down:"
            echo $DEV_UP
            echo $"Devices with modified configuration:"
            echo $DEV_RECONF
      else
            echo $"Currently active devices:"
            echo `/sbin/ifconfig | grep ^[a-z] | awk '{print $1}'`
      fi
      ;;
  restart)
        cd $CWD
      $0 stop
      $0 start
      ;;
  reload)
      if [ -x /sbin/linuxconf ] ; then
            eval `/sbin/linuxconf --hint netdev`
            for device in $DEV_UP ; do
                  action $"Bringing up device $device: " ./ifup $device
            done
            for device in $DEV_DOWN ; do
                  action $"Shutting down device $device: " ./ifdown $device
            done
            for device in $DEV_RECONF ; do
                  action $"Shutting down device $device: " ./ifdown $device
                  action $"Bringing up device $device: " ./ifup $device
            done
            for device in $DEV_RECONF_ALIASES ; do
                  action $"Bringing up alias $device: " /etc/sysconfig/network-scripts/ifup-aliases $device
            done
            for device in $DEV_RECONF_ROUTES ; do
                  action $"Bringing up route $device: " /etc/sysconfig/network-scripts/ifup-routes $device
            done
            case $IPX in yes|true)
              case $IPXINTERNALNET in
                reconf)
                  action $"Deleting internal IPX network: " /sbin/ipx_internal_net del
                  action $"Adding internal IPX network $IPXINTERNALNETNUM $IPXINTERNALNODENUM: " /sbin/ipx_internal_net add $IPXINTERNALNETNUM \
                                          $IPXINTERNALNODENUM
                  ;;
                add)
                  action $"Adding internal IPX network $IPXINTERNALNETNUM $IPXINTERNALNODENUM: " /sbin/ipx_internal_net add $IPXINTERNALNETNUM \
                                          $IPXINTERNALNODENUM
                  ;;
                del)
                  action $"Deleting internal IPX network: " /sbin/ipx_internal_net del
                  ;;
              esac
              ;;
            esac
      else
              cd $CWD
            $0 restart
      fi
      ;;
  probe)
      if [ -x /sbin/linuxconf ] ; then
            eval `/sbin/linuxconf --hint netdev`
            [ -n "$DEV_UP$DEV_DOWN$DEV_RECONF$DEV_RECONF_ALIASES" -o \
              -n "$DEV_RECONF_ROUTES$IPXINTERNALNET" ] && \
                  echo reload
            exit 0
      else
            # if linuxconf isn't around to figure stuff out for us,
            # we punt.  Probably better than completely reloading
            # networking if user isn't sure which to do.  If user
            # is sure, they would run restart or reload, not probe.
            exit 0
      fi
      ;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload|status|probe}"
        exit 1
esac

exit 0

------------------------------------
and the /etc/sysconfig/network-scripts/ifcfg-eth0 file is as follows
DEVICE="eth0"
ONBOOT="yes"
BOOTPROTO="none"
IPADDR="192.168.1.251"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
IPXNETNUM_802_2=""
IPXPRIMARY_802_2="no"
IPXACTIVE_802_2="no"
IPXNETNUM_802_3=""
IPXPRIMARY_802_3="no"
IPXACTIVE_802_3="no"
IPXNETNUM_ETHERII=""
IPXPRIMARY_ETHERII="no"
IPXACTIVE_ETHERII="no"
IPXNETNUM_SNAP=""
IPXPRIMARY_SNAP="no"
IPXACTIVE_SNAP="no"

When it was working with dhcp network was working fine so do u think there can be a driver problem.
Regards
Manoj Mathew

regards manoj

Top Expert 2005

Commented:
If it was a driver problem you'd have had difficulties getting DHCP to work, so that's not it.

I've got a problem with what you say is the contents of /etc/sysconfig/network. What is above for the contents of that file is in fact what should be in /etc/init.d/network. /etc/sysconfig/network should contain something along the lines of:

NETWORKING=yes
HOSTNAME=my-box.my-dom.tld
GATEWAY=192.168.1.1

The only thing that I'd change in /etc/sysconfig/network-scripts/ifcfg-eth0 is that I'd set:

BOOTPROTO="static"

Author

Commented:
Hi jlevie
sorry about that...
well the information u asked is here

NETWORKING=yes
HOSTNAME=interlinux
GATEWAY="192.168.1.1"
GATEWAYDEV="eth0"
FORWARD_IPV4="false"

and I tried making BOOTPROTO="static" it did not work

Author

Commented:
That is the network did not start up

Regards manoj mathew
jlevie, you can not configure your network unless you have the lan card. And it does say so that there is no device found. So, no matter what you do, manipulate your network configuration as much as you want, nothing will happen.
It has happened to me many times before, and all i do is re-install the lan card driver.

Author

Commented:
Hi
 Well to add one more thing when i go back to configure it as dhcp client again it works quite fine and i am able to access the network..
 So if there is a problem with the driver why would it behave ok when it is dhcp client.
 My comp is a Dell optiplex GX150 model
 and i have installed and successufuly run linux on my other machine without having to load the drivers.
 Regards Manoj Mathew
Top Expert 2005

Commented:
lloco_lloco,

Notice that the boot up dialog says:

Bringing up interface eth0:                 [OK]
SIOCADDRT: No device found

So it does bring up eth0, meaning that the driver did load and was sucessfully configured. The SIOCADDRT is probably from something that is happening after eth0 comes on line. And that could be that the system is trying to configure some other device. The question is what?

ManojMathew,

After you boot the system what do you see from 'ifconfig -a' and what does 'netstat -rn' say?

Author

Commented:
ifconfig -a
gives  
eth0
Link encap : Ethernet  HWaddr 00:B0:D0:D2:90:C1
inet addr:192.168.1.251 Bcast:192.168.1.255 Mask:255.255.255.0
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric :1
RX packets:57 the rest is all having value 0
TX packets:86 the rest is all having value 0
Collisions:0
RX bytes:8132(7.9kb) TX bytes:5160(5.0kb)


and similarly shows details for lo
with message UP LOOPBACK RUNNING

Regards Manoj Mathew
Top Expert 2005

Commented:
And this is with the NIC statically configured, right?

What does 'netstat -rn' show?

Author

Commented:
ya that is right it is statically configured
And the netstat -M doesnot give any output.
Top Expert 2005

Commented:
The command wasn't 'netstat -m' it was 'netstat -rn' or entered another way 'netstat -r -n'.

Author

Commented:
Sorry i misread it ..well the out put it is as follows

Destination  Gateway  Genmask      Flags   MSS      Window  irtt Iface
192.168.1.0  0.0.0.0   255.255.255.0  U   40     0
0      eth0
127.0.0.0   0.0.0.0      255.0.0.0    U   40   0          0      lo
0.0.0.0    192.168.1.1  0.0.0.0      UG   40   0          0      eth0

Author

Commented:
well sorry it was all jumbeled up
Destination Gateway Genmask    Flags   MSS      Window  irtt Iface
192.168.1.0 0.0.0.0   255.255.255.0  U         40     0               0      eth0
127.0.0.0   0.0.0.0      255.0.0.0       U              40      0             0      lo
0.0.0.0    192.168.1.1  0.0.0.0         UG       40     0               0      eth0

Top Expert 2005

Commented:
Okay routes look okay.

The ifconfig output posted earlier and the routing tables would tend to indicate that the NIC should be working. But from the question you stated that you can't access the network.

Does that mean that you can't ping other nodes, say the router (ping -n 192.168.1.1)? Or does that mean that you can't access hosts by name?

Before assiging the static IP to this machine have you verified that it isn't already in use on the network and isn't within the pool of addresses that the dhcp server manages?

Author

Commented:
No i have confirmed that the ip is not used in the network.
Ya u got it right i can't ping any of the network addresses niether 192.168.1.1
it gives me
 
from 192.168.1.251 : destination host unreachable

 when i try to ping 192.168.1.1

and my dhcp pool of addresses are of 172.16 range..
 
Top Expert 2005

Commented:
This box is configured to be on the 192.168.1.0/24 network, but the DHCP server is using IP's from the 172.16.0.0/12 network. Are both networks in use? And is there a router on the network at 192.168.1.1?

If the network the machine connects to doesn't have a router at 192.168.1.1 you'd get the "SIOCADDRT: No device found" and the "destination host unreachable" errors.

I suspect that the problem is that you need to assign this machine an IP from the 172.16.0.0/12 address space.

Author

Commented:
Ok u see my network does have a router but it is not 192.168.1.1. so how do I get this problem right.And why is it necessary for me to have router at 192.168.1.1 When i installed linux on one of my other pc's by giving th static IP it worked just fine
Top Expert 2005

Commented:
In this case you picked an IP that isn't a part of the local network. That's okay, but it won't be able to talk to any of the machines in the 172.16 network. It will only be able to talks to other machines configured to be on the 192.168.1.0/24 network that are on the same network segment. After configuring the network interface RedHat attempted to contact the router you specified as the default route (to find out if it was reachable and was in fact a router) which is what caused the "SIOCADDRT: No device found".

For this system to work correctly it will probably have to have an IP lying within your local network (the 172.16 network). And to be able to go anywhere the system will have to be configured to use the IP of the gateway router on that network and the DNS server for the local network. Doing that with a static IP probably means requesting the IP from your network administrator.

Author

Commented:
Well to be more specific i am the network administrator here.
You see We have a network of about 600 computers all in the 192.168. range and all (except my proxy server) running on windows
I created a small network for myself which had nothing to do with the other machines in the network and I had used the 172.16 ip's
Now when i want to put back my linux pc into the original network it is not happenning .
Now i think my problem is clear to u...
Top Expert 2005

Commented:
So the network that this system is connected to is using IP's from the 192.168.1.0/255/255.255.0 range? and the router on the segment that you are connecting to is at 192.168.1.1?

Given the number of nodes that you say you have, is it possible that the netmask isn't 255.255.255.0?

Author

Commented:
I have 6 different vlans
the machine i am connecting is in 192.168.1.x series
Top Expert 2005

Commented:
Okay, that makes sense.

The router on this VLAN is 192.168.1.1, right?

What switches are you using?

Is the NIC in the Linux box a 10/100 card? How is the switch port configured? Is it set to auto or a fixed speed/mode? Have you tried a different port and cable?

Author

Commented:
See to be more specific
If i configure a fresh machine with linux and give it a static ip and it is connected to the same port and same ip then it would work fine.
I think there is something wrong with the linux configuration files somewhere...Somewhere there is still the reminance of the old configuration..
can u give me the list of all the files  which are affected by the network settings.
Top Expert 2005

Commented:
On a redhat box, the files that are a part of the network configuration for eth0 are:

/etc/hosts
/etc/resolv.conf
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0

Commented:
EXPERTS BEWARE!

DANGER, this user give "C" grades for unexplained reasons:

http://www.experts-exchange.com/Operating_Systems/Win2000/Q_20526543.html

Author

Commented:
Hi
I have re-installed linux on that machine and now it works fine.
I would like to request the moderators to refund my point as I could not get a solution for it.
But I would like to thank all those who tried to help.
Regards
Manoj
Request has been made as indicated above.  Experts, Please provide feedback within 72 hours on the dispostion.  Failing that I intend to honor the request and PAQ with a refund on 3/3/2003.

SpideyMod
Community Support Moderator @Experts Exchange
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial