Solved [Solved] Assignment of IP address using DHCP fails at boot

Newbie question here. I'm trying to get my main FreeBSD machine to obtain an IP address automatically through DHCP (Ethernet connection). This fails if I set the proper (?, not entirely sure) settings in rc.conf, but works fine if I manually use

Code:
dhclient fxp0

at the command prompt after booting.

I had to set up my network card separately after the installation, as during installation I had no network cable plugged in.

The lines related to ifconfig in rc.conf are as follows:

Code:
ifconfig_fxp0="SYNCDHCP"
ifconfig_fxp0=" inet  netmask"
defaultrouter=""

The first line was set to DHCP earlier, but I changed it after reading http://www.nl.freebsd.org/doc/handbook/network-dhcp.html and figuring that maybe the system needing a bit more time to obtain the IP address.

What I do know about the hardware is that in Windows XP on the same machine renewing the DHCP-lease also fails, unless I reset my cable modem (probably an issue with the cable modem). However, I hope there is a simple solution for this in FreeBSD.
Edit: The machine is a Dell Dimension 4600, and the NIC is the one built into the motherboard.
 
Re: Assignment of IP address using DHCP fails at boot

Try the easy stuff first: set a longer timeout in /etc/dhclient.conf:
Code:
timeout 120;

If that does not work, dhclient(8) could be run from /etc/rc.local. That does not solve the problem with Windows, though.

If possible, find another Ethernet card to test. Some take a long time to connect. The cable modem could have a gigabit interface, adding to the delay while the old fxp(4) card tries to figure it out. Adding a small switch or even a hub between the cable modem and computer could help avoid that autonegotiation. It might also be possible to set the cable modem to 10/100.

Do not buy a hub, they should be free. PCI Ethernet cards should be nearly as cheap.
 
Re: Assignment of IP address using DHCP fails at boot

Thomash said:
Code:
ifconfig_fxp0="SYNCDHCP"
ifconfig_fxp0=" inet  netmask"
defaultrouter=""
You're setting the address by hand instead of using DHCP. The last ifconfig_fxp0 entry overrules the first. Remove defaultrouter too as it receives that information from DHCP.
 
Re: Assignment of IP address using DHCP fails at boot

SirDice said:
Thomash said:
Code:
ifconfig_fxp0="SYNCDHCP"
ifconfig_fxp0=" inet  netmask"
defaultrouter=""
You're setting the address by hand instead of using DHCP. The last ifconfig_fxp0 entry overrules the first. Remove defaultrouter too as it receives that information from DHCP.

Thank you! That fixed it. I guess the second and third lines got inserted when I installed FreeBSD and couldn't figure out how to get past the network configuration screen without entering any settings. :r

Now to sort out what went wrong during my Xorg install (but that's for another topic).
 
Re: Assignment of IP address using DHCP fails at boot

Hm, I saw the first line and missed the rest. Now I want to know why it has problems with XP.
 
Re: Assignment of IP address using DHCP fails at boot

wblock@ said:
Hm, I saw the first line and missed the rest. Now I want to know why it has problems with XP.

It is very slow to obtain an IP address in FreeBSD, so maybe too slow for XP? The Dell is not the only machine I have that has problems with DHCP and this particular cable modem, by the way.

I don't particularly care that XP lacks an internet connection most of the time, considering Microsoft doesn't support it anymore and the amount of malware and other junk that target it. Better keep it off the net.
 
Back
Top