# dhcpcd and openrc net.x: how to get both IPv4 and IPv6 addr

## ckonstanski1

I am adding IPv6 to my home network (in addition to the IPv4 already present). I got dhcpd working for both IPv4 and IPv6 on the server end:

- Gave the router a static IPv6 address

- Set up radvd to advertise the IPv6 subnet in managed mode (for stateful addressing)

- Symlinked /etc/init.d/dhcpd to /etc/init.d/dhcpdv6

- Created /etc/conf.d/dhcpdv6

- Configured it with DHCPD_OPTS="-6"

- Created /etc/dhcp/dhcpdv6.conf with a subnet6

- rc-update add dhcpdv6 default

Now I have both dhcp v4 and v6 running. I know it's working because my printer is getting an IPv6 address. It's even the correct address that I made a reservation for. I can see the DUID in /var/log/messages.

The problem: the gentoo clients are not even trying dhcpv6. They're only doing IPv4. I can't figure out how to make them request both types of addresses.

----------

## Ant P.

You haven't mentioned which DHCP client you're using on the Gentoo machines. What do you have installed and does it generate any errors?

----------

## UberLord

He mentions dhcpcd in the topic title, so lets assume it's that.

If you have changed /etc/dhcpcd.conf, please post that here.

Then issue this:

```
dhcpcd -k

dhcpcd -dB6
```

This will go through the IPv6 setup process only (such as not to muddy output with IPv4 setup).

Ctrl-C to stop.

Paste results here.

To capture same results to a log file, add this to dhcpcd.conf

```
debug

logfile /var/log/dhcpcd.log
```

----------

## Ant P.

 *UberLord wrote:*   

> He mentions dhcpcd in the topic title, so lets assume it's that.

 

My bad, I misread it as "dhcpd" after reading the post. The names *are* a little close together...

----------

## ckonstanski1

Confirmed: I am using dhcpcd. I had not made any modifications to dhcpcd.conf prior to posting to this forum.

I added the debug statements to the config file and ran the commands. Here is the output:

https://paste.pound-python.org/show/BWN91bdcKvkLgQbZXhtH/

We are talking about the wlan0 interface. This looks like the most interesting line:

```
wlan0: No DHCPv6 instruction in RA
```

I don't know if that's meaningful or just a red herring. By that point the IPv6 address is already assigned. It looks like a stateless radvd IP. Perhaps I have radvd configured wrong?

My radvd.conf on the router:

https://paste.pound-python.org/show/u8pHTrlV9kHoj3rAYC3F/

----------

## UberLord

dhcpcd is not seeing the managed flag!

7.0.1 is an old version these days, can you try upgrading to 7.0.8?

----------

## ckonstanski1

Upgraded to 7.0.8. Same issue. I will try a different DHCP client.

----------

## ckonstanski1

Solved. dhcpcd is still the best option for a DHCP client. The problem was the radvd config. I think that advertising the subnet caused it to override the managed mode setting. So I removed the prefix entirely.

```
interface enp3s0 {

    AdvManagedFlag on;

    AdvSendAdvert on;

    AdvOtherConfigFlag on;

    MinRtrAdvInterval 3;

    MaxRtrAdvInterval 60;

};
```

Thanks for the help!

----------

## UberLord

Yay!

----------

