ipcalc problem

Steve zephod at cfl.rr.com
Thu Feb 19 16:20:49 UTC 2009


Or at least it looks like an ipcalc problem to me.

# rpm -q --whatprovides /bin/ipcalc
initscripts-8.76.4-1.x86_64

I've been on a long wild goose chase trying to figure out why I get one of two different hostnames alternatively when I boot the system. Based on what I read in the dhclient man page, I believed that the hostname was provided by the dhcp server in a dhcp protocol message. While that may still be true, my F9 system does not use that potential source of information to set the hostname. The hostname is actually set in the /etc/sysconfig/network-scripts/ifup-post script by this code:

# don't set hostname on ppp/slip connections
if [ "$2" = "boot" -a \
     "${DEVICE}" != lo -a \
     "${DEVICETYPE}" != "ppp" -a \
     "${DEVICETYPE}" != "slip" ]; then
    if need_hostname; then
        IPADDR=$(LANG=C ip -o -4 addr ls dev ${DEVICE} | awk '{ print $4 ; exit }')
        eval $(/bin/ipcalc --silent --hostname ${IPADDR} ; echo "status=$?")
        if [ "$status" = "0" ]; then
            set_hostname $HOSTNAME
        fi
    fi
fi

if I run /bin/ipcalc at a command line a couple of times I get this:

# /bin/ipcalc --hostname 192.168.1.186/24
HOSTNAME=host_A
# /bin/ipcalc --hostname 192.168.1.186/24
HOSTNAME=host_B
# /bin/ipcalc --hostname 192.168.1.186/24
HOSTNAME=host_A
# /bin/ipcalc --hostname 192.168.1.186/24
HOSTNAME=host_B

ie my alternating hostname.

Can anyone think of an explanation for this?

I am going to investigtate the possibility of two machines having the same IP address but I think that I would have way more problems that just a host name issue.

Thanks,
Steve






More information about the fedora-list mailing list