# Problems with DHCP after 7.2 to 8.0 upgrade



## neildarlow (Dec 4, 2009)

Hi,

I run a FreeBSD gateway with a DHCP-assigned external address. I haven't changed the networking configuration since upgrading from 7.2 to 8.0.

Under 7.2, when I executed /etc/rc.d/netif restart, you would see the DHCP-assigned values before the ifconfig output during the network startup.

Under 8.0, executing /etc/rc.d/netif restart doesn't present the DHCP-assigned values and the external interface is left without an IP address. I have to physically disconnect the external interface from my cable modem and reconnect it in order to acquire a DHCP-assigned IP address.

It appears as if /etc/rc.d/netif is not correctly handling the case of DHCP-managed interfaces for the restart operation. Does this make sense, is it a known problem?

TIA,
Neil Darlow


----------



## crsd (Dec 4, 2009)

Works here:

```
# /etc/rc.d/netif restart msk0
Stopping Network: msk0.
msk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=11a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4>
        ether 00:0f:ea:7e:00:04
        media: Ethernet autoselect
msk0: no link .... got link
DHCPREQUEST on msk0 to 255.255.255.255 port 67
DHCPREQUEST on msk0 to 255.255.255.255 port 67
DHCPACK from 10.1.72.1
bound to 10.1.79.202 -- renewal in 302400 seconds.
Starting Network: msk0.
msk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=11a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4>
        ether 00:0f:ea:7e:00:04
        inet 10.1.79.202 netmask 0xfffff800 broadcast 10.1.79.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
```


----------



## neildarlow (Dec 4, 2009)

I think the significant part of your output is the *no link .... got link*. I don't get the DHCPREQUEST/DHCPACK output when I try the same thing.

What specific version of 8.0 are you running? I am running RELENG_8_0


----------



## SirDice (Dec 4, 2009)

What happens if you use *dhclient*?


----------



## neildarlow (Dec 4, 2009)

Running *dhclient vr0* does what you expect:
1) Sends DHCPREQUEST
2) Receives DHCPACK and interface is bound to an IP address


----------



## SirDice (Dec 4, 2009)

Hmm.. Ok.. That means the problem is either in /etc/rc.d/netif or /etc/rc.conf.

What does that line look like in rc.conf?

Do you also have an "network_interfaces" line? If so, remove it.


----------



## neildarlow (Dec 4, 2009)

The, networking-related, lines from rc.conf are:


```
gateway_enable="YES"
hostname="router.darlow.co.uk"
ifconfig_vr0="dhcp polling"
ifconfig_vr1="inet 192.168.0.1 netmask 255.255.255.0 polling"
ipv6_enable="YES"
static_routes="multicast"
route_multicast="-net 224.0.0.0/4 -interface vr1"
```

This is a configuration that has been working without problems for over 3 years before I upgraded to 8.0.


----------



## SirDice (Dec 4, 2009)

Try removing that polling option.


----------



## blairchen (Dec 5, 2009)

Hi all,

I'm newbie here. I got a similar situation after upgrading to RELENG_8.
I also miss my DHCP configuration after that. I found that DHCP client didn't wait for network interface got ready in RELENG_8. As a result, I try to find any configuration in default setting in rc.conf and add synchronous_dhclient="YES" in my freebsd box finally. Everything for me is ok now. Wish it's helpful for you.

Sincerely,
Blair


----------



## neildarlow (Dec 5, 2009)

@blairchen: Thank you for that information. It's good to see that I'm not the only one experiencing this problem. I'll give it a try.

@SirDice: Removing the *polling* option didn't have any effect.


----------



## neildarlow (Dec 5, 2009)

Excellent suggestion blairchen!

Changing my vr0 configuration in /etc/rc.conf as follows fixes the problem.


```
ifconfig_vr0="syncdhcp polling
```

Now when I execute */etc/rc.d/netif restart* a DHCP-assigned address results.


----------



## DutchDaemon (Dec 5, 2009)

Isn't that the same as putting this in /etc/rc.conf?


```
synchronous_dhclient="YES"
```

From /etc/defaults/rc.conf:


```
synchronous_dhclient="NO"       # Start dhclient directly on configured
                                # interfaces during startup.
```


----------



## neildarlow (Dec 6, 2009)

I think *synchronous_dhclient* acts as a global switch but with *syncdhcp* you can apply the setting on a per-interface basis (if I'm right in thinking a dhclient is assigned per interface).

Quite likely, for my case of a single DHCP-managed interface, the two are equivalent but I don't like to make assumptions about global behaviour when more specific controls are available.


----------

