# dhcp/dhclient issues



## bsdrocks (Jun 15, 2010)

Problem: dhclient doesn't get ip before the login prompt appears during boot.

This results in a few problems:
1. nfs shares with hostname in /etc/fstab results in single user mode during boot since hostname cannot be resolved (using IP instead of hostnames will only results in a lot of cannot mount messages and then it continues and when login prompt shows up, it mounts the nfs shares..)
2. sshd cannot bind to ip and fails to start
3. and lots of frustration!

All of my freebsd boxes, except for one (the problematic one) will halt during boot to receive a DHCPOFFER and then continue and begin mounting nfs shares etc.. So what makes this one different? Well  all the other ones are sparc64 and this one is amd64, and thats about it... /etc/rc.conf, /etc/sysctl.conf, /etc/fstab, /etc/resolv.conf, /etc/dhclient.conf (empty) and /etc/pf.conf is identical on all the machines..  



/etc/rc.conf:

```
hostname="x64.example.com"
ifconfig_em0="DHCP"
sshd_enable="YES"
sendmail_enable="NONE"
#kern_securelevel_enable="YES"
#kern_securelevel="2"
portmap_enable="NO"
inetd_enable="NO"
clear_tmp_enable="YES"
syslogd_flags="-ss -C"
icmp_drop_redirect="YES"
icmp_log_redirect="YES"
log_in_vain="YES"
uptimed_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
ezjail_enable="YES"
zfs_enable="YES"
```

uname -a

```
FreeBSD x64.example.com 8.0-RELEASE-p3 FreeBSD 8.0-RELEASE-p3 #0: Tue May 25 20:54:11 UTC 2010     [email]root@amd64-
builder.daemonology.net[/email]:/usr/obj/usr/src/sys/GENERIC  amd64
```


What could this come of? what makes the other machines wait for DHCPOFFER? and what makes this one skip it? Could it be that all the others are single core, while the problematic one is dual core?


----------



## DutchDaemon (Jun 15, 2010)

Have you tried 


```
synchronous_dhclient="YES"
```

in /etc/rc.conf?


----------



## bsdrocks (Jun 15, 2010)

That did it! Thanks!


----------



## wblock@ (Jun 15, 2010)

ifconfig_em0="SYNCDHCP" is a little different notation for the same thing.


----------

