# dhclient misbehaving



## roberthuff (Mar 29, 2014)

I have a system, running r263263, where dhclient is misbehaving. The system has an Intel Pro/1000 ethernet card, em0, connected to a Arris CM820 cable modem.

This is the relevant portion of dhclient.conf:


```
timeout 120;
retry 30;
reboot 30;
select-timeout 0;
initial-interval 30;

supersede domain-name "litteratus.org";
prepend domain-name-servers 10.0.0.1;

interface "em0" {
   request subnet-mask, broadcast-address,
		 time-offset, time-servers,
		 routers, domain-name-servers;
   require subnet-mask, routers,
		 domain-name-servers;
    media "media 10baseT/UTP";
}
```
Upon execution, I get this:


```
DHCPREQUEST on em0 to 255.255.255.255 port 67
DHCPACK from 10.23.192.1
bound to 209.6.39.223 -- renewal in 302400 seconds.
```

but then:


```
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
	ether 00:04:23:e5:50:6c
	inet6 fe80::204:23ff:fee5:506c%em0  prefixlen 64 tentative scopeid 0x1
	inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
```

`netstat -r` also shows no gateway.

However, when I look at dhclient.leases:


```
lease {
  interface "em0";
  fixed-address 209.6.39.223;
  medium "auto";
  option subnet-mask 255.255.252.0;
  option routers 209.6.36.1;
  option ien116-name-servers 208.59.247.45,208.59.247.46;
  option domain-name-servers 208.59.247.45,208.59.247.46;
  option host-name "000423e5506c";
  option domain-name "cable.rcn.com";
  option broadcast-address 255.255.255.255;
  option dhcp-lease-time 604800;
  option dhcp-message-type 5;
  option dhcp-server-identifier 146.115.2.241;
  renew 5 2014/3/28 13:15:11;
  rebind 1 2014/3/31 04:15:11;
  expire 2 2014/4/1 01:15:11;
}
```

I get the machine working by configuring the relevant data manually.

I have no idea where to start trying to figure this out; this have "just worked" for so long. Help please?

Respectfully,

Robert Huff


----------



## SirDice (Mar 31, 2014)

What happens if you remove all the options from dhclient.conf? I rarely have to edit that file. If you want to use your own DNS servers I've found it was easier to do via a /etc/dhclient-enter-hooks script:

```
add_new_resolv_conf() {
        return 0
}
```
This simply prevents dhclient(8) from overwriting /etc/resolv.conf.


----------

