1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

DHCPv6 - dhclient

Discussion in 'Networking' started by r00t, Aug 7, 2009.

  1. r00t

    r00t New Member

    Messages:
    14
    Thanks Received:
    0
    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!
     
  2. brd@

    brd@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    284
    Thanks Received:
    67
    Try using the rtsol command instead like this:
    Code:
    rtsol interface

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

    r00t New Member

    Messages:
    14
    Thanks Received:
    0
    [Solved]

    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.
     
  4. brd@

    brd@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    284
    Thanks Received:
    67
    Aha, that makes more sense. I was not even thinking rtsol was for autoconfiguration. On my IPv6 networks it is just "the way." :)
     
  5. paravpandit

    paravpandit New Member

    Messages:
    7
    Thanks Received:
    0
    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.

    Code:
    	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();
    		}
     
  6. paravpandit

    paravpandit New Member

    Messages:
    7
    Thanks Received:
    0
  7. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,917
    Thanks Received:
    2,517
    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.
     
  8. r00t

    r00t New Member

    Messages:
    14
    Thanks Received:
    0
    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.
     
  9. paravpandit

    paravpandit New Member

    Messages:
    7
    Thanks Received:
    0
    Yes you are right. Using mix of stateless and stateful was not the intention.