DHCP on AtHome network (sending hostname in dhcpcd)

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
elmar
Posts: 1
Joined: Tue 13 Jun 2006, 18:38

DHCP on AtHome network (sending hostname in dhcpcd)

#1 Post by elmar »

The AtHome ISP requires the hostname of the computer to be sent to the DHCP server when requesting an IP, otherwise DHCP will fail. This is only an issue if the pc is hooked directly to the cable modem.
Here is how I solved this for Puppy 2.0.0:

change /etc/rc.d/rc.network line 164 from:

Code: Select all

dhcpcd ${INTERFACE}
to:

Code: Select all

HOSTNAME=`cat /etc/hostname`
dhcpcd -h ${HOSTNAME} ${INTERFACE}
change /usr/sbin/net-setup.sh line 590 from:

Code: Select all

if dhcpcd -d "$INTERFACE"
to:

Code: Select all

HOSTNAME=`cat /etc/hostname`
if dhcpcd -d -h ${HOSTNAME} "$INTERFACE"
change /usr/sbin/net-setup.sh line 612 from:

Code: Select all

dhcpcd ${INTERFACE}
to:

Code: Select all

HOSTNAME=\`cat /etc/hostname\`
dhcpcd -h \${HOSTNAME} ${INTERFACE}
Make sure you set /etc/hostname to contain the hostname issued by AtHome.

I'm not even sure if the change to rc.network is required - that part of the change was left over from my solution to the problem in Puppy 1.0.7

This fix does not seem to hurt even when not on the AtHome network.

Elmar

Post Reply