# DHCPv6 - dhclient



## r00t (Aug 7, 2009)

Hi everyone!

I'm trying to assign IPV6 addresses on my network with dhcpd.
I have a freebsd machine acting as a dhcp server and it is working well : a windows client gets its IPv6 address from the server. 

But I can't get a freebsd client to get its address.

I'm wondering if dhclient supports IPv6 or if I should find some other client.

NOTE: When I manually assign two IPv6 addresses, communication does work. Really seems like dhclient is not doing what it should.

Hope someone can help!
Thanks!


----------



## brd@ (Aug 9, 2009)

Try using the rtsol command instead like this:
	
	



```
rtsol [i]interface[/i]
```
When you set `ipv6_enable="YES"' in /etc/rc.conf, the rtsol client is used instead of dhclient. So give this a shot.


----------



## r00t (Aug 10, 2009)

*[Solved]*



			
				brd@ said:
			
		

> Try using the rtsol command instead like this:
> 
> 
> 
> ...



Thanks but that was not the problem!
I was trying to set up DHCPv6 stateful, therefore rtsol had nothing to do with it since I'm not using autoconfiguration.

The problem is that my system was using dhclient located in /sbin and should've been using the dhclient in /usr/local/sbin -> It's a FreeBSD system. The latter is the most recent and takes the "-6" option to startup in IPv6 mode whereas the first doesn't.


----------



## brd@ (Aug 10, 2009)

Aha, that makes more sense. I was not even thinking rtsol was for autoconfiguration. On my IPv6 networks it is just "the way."


----------



## paravpandit (Aug 14, 2009)

Hi,

With reference to this I am referring to the HEAD code base of dhclient.
It doesn't seem to take -6 as the argument for IPv6 DHCP functionality. Here is the snippet. 
Even in the code, doesn't find any reference to IPv6 packet formatting, parsing, using UDP different UDP port numbers for IPv6 etc.


```
while ((ch = getopt(argc, argv, "bc:dl:qu")) != -1)
		switch (ch) {
		case 'b':
			immediate_daemon = 1;
			break;
		case 'c':
			path_dhclient_conf = optarg;
			break;
		case 'd':
			no_daemon = 1;
			break;
		case 'l':
			path_dhclient_db = optarg;
			break;
		case 'q':
			quiet = 1;
			break;
		case 'u':
			unknown_ok = 0;
			break;
		default:
			usage();
		}
```


----------



## paravpandit (Aug 14, 2009)

Even man page also doesn't say anything about v6.
http://www.freebsd.org/cgi/man.cgi?query=dhclient&sektion=8

Do you mean IPv6 DHCP is handled fully in rtsol?
http://www.isc.org's dhclient seems to have both of them in one daemon, of course not at the same time unlike dhclient and rtsol as separate daemons?


----------



## SirDice (Aug 14, 2009)

AFAIK rtsol is used to listen to router advertisements done by rtadvd. Of course it's only able to get an IP address and a route that way. No way of setting DNS. I more or less solved that by using MDNS.

Currently my own network is still using both IPv4 and IPv6 protocols.


----------



## r00t (Aug 17, 2009)

I think the dhclient I'm using with the -6 option is the ISC one (located in /usr/local/sbin). The base dhclient does not take that option as you mentioned.

From what I understand, you can configure IPv6 addresses in two ways:

- stateless : no DHCP to assign addresses. IP addresses are built by using autoconfiguration and by having routers announce the IP addresses of machines in the network. Therefore, rtsol is needed to 'solicitate' that info from routers.

- stateful : DHCP is used to assign addresses. An IPv6 compatible dhclient is needed, no autoconfiguration occurs, rtsol is no needed.

Of course, some mixtures are possible. For example, using autoconfiguration to get IPv6 addresses AND using dhcp to get other information, such as DNS servers addresses, etc.. But this was not the intended functionality in the original post.

Correct me if I'm wrong.

Regards.


----------



## paravpandit (Aug 18, 2009)

Yes you are right. Using mix of stateless and stateful was not the intention.


----------

