Re: ifup fails for static IP address. Is ifcfg wrong?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Art Edwards wrote:
I just installed Fedora core 5. I have a static IP address. When the system boots it tells me that this IP address is already in use. It then defaults to dhcp. I have looked at the /sbin/ifcfg code, where the error arises, and I find
the following:

if ! arping -q -c 2 -w 3 -D -I $dev $ipaddr ; then
echo "Error: some host already uses address $ipaddr on $dev." 1>&2
exit 1
fi

When I issue the same command (without the -q switch) with eth0 substituted for $dev and my ipaddress substituted for $ipaddr, I receive no response. However, when I issue the same command with another ip address that I know is active, I receive an affirmative.

I think that the code above is incorrect. Specifically, I think the ! (not) is wrong.

No, that code is correct.  In a shell script, "if ! arping ..."
does not mean "if arping returns 0".  It means "if the arping
command fails", and "arping -D" gives a failure (i.e., non-zero)
return code if it detects a reply.

I don't know why you're having a problem.  My FC5 test box is
set up with a static IP address on its one and only ethernet
interface, and that is working fine for me.

  [root@omega-3b ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
  # Intel Corporation 82801DB PRO/100 VM (LOM) Ethernet Controller
  DEVICE=eth0
  BOOTPROTO=static
  BROADCAST=192.168.43.255
  HWADDR=00:0B:CD:98:7A:48
  IPADDR=192.168.43.50
  NETMASK=255.255.255.0
  NETWORK=192.168.43.0
  ONBOOT=yes
  [root@omega-3b ~]#

--
Bob Nichols         Yes, "NOSPAM" is really part of my email address.

--
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux