# dhclient and intermittent connection



## gonesurfing (Aug 22, 2010)

The setup: 2 interface box running pf/nat/djbdns/etc on cable internet provider.

The trouble started about 6+ months ago when I upgraded my firewall/NAT machine from 7.2-RELEASE to 8.0-RELEASE.  Anytime the power blinked and the box reset, the home network would come to a halt. After much troubleshooting between dnscache, pf, nat, dhclient I finally realized the root cause was that the outside interface would stop passing packets.  The normal flood of BOOTP and ARP traffic on the outside interface was very sparse under tcpdump and even "pass all" under pf did nothing to restore it.  Whenever something abnormal such as this happened under 7.2, a quick drop to single user mode and "exit" would restart all services and the box would be happy again.  This no longer works under version 8 (or 8.1), and only a full reboot will restore order to the outside interface.  Weeks would go by working correctly, and then suddenly all traffic would stop again if the cable modem reset or power blinked. Then it would work for a few hours or a day, and die again without any external influence.

I've finally discovered what may be the root of the problem. Whenever the machine is booted normally, dhclient refreshed the lease on my outside interface and then goes to sleep in the background. pgrep or ps -ax shows two dhclient processes bound to fxp1. This same behavior happens if I boot to single user mode and then "exit" into multi-user mode.  However, if I drop to single-user from multi-user and then exit back out, dhclient never re-starts. Even "service dhclient start" does nothing. I've tried a fresh install on a spare box, and the same behavior occurs.

So... why isn't dhclient restarted when bringing up multi-user?  Again, this seems to have changed from all previous < 8.0 releases.

Thanks in advance.

Eric


----------



## phoenix (Aug 22, 2010)

Does `# service netif restart fxp1` in multi-user fix the issue?


----------



## gonesurfing (Aug 22, 2010)

phoenix said:
			
		

> Does `# service netif restart fxp1` in multi-user fix the issue?



No, all it does is erase the previously assigned address.


----------



## gonesurfing (Aug 25, 2010)

Well, I appear to have solved the issue with dhclient not starting when exiting single-user mode.  As many other weird networking issues appear to have been solved, simply changing 
	
	



```
ifconfig_fxp1= "DHCP"
```
 to 
	
	



```
ifconfig_fxp1="SYNCDHCP"
```
 in /etc/rc.conf resolved the issue.

Time will tell if this is the only reason for loss of traffic on the outside interface. I've since found and fixed another dnscache issue that happened when the router booted before the cable modem was online and the list of forwarded nameservers was out of date.


----------

