# DHCPv6 sets wrong prefix

## MorpheuS.Ibis

Hi,

I have a problem with dhcpv6, on a network with /117 prefix (chosen by network administrator, not by me)

dmesg is filled with 

```
IPv6 addrconf: prefix with wrong length 117
```

when requesting an IP address with dhcp6c I get the following error 

```
assigned address 2001:x:x:x::514 prefix len is not in any RAs prefix length using 64 bit instead
```

 but I have received RA with /117 prefix, my routing table contains 

```
2001:x:x:x::/117 dev eth0  proto kernel  metric 256  expires 2147157sec mtu 1500 advmss 1440 hoplimit 4294967295
```

 (with a real address, same prefix as above)

any ideas where to look? is there a way to list recently received RAs?

----------

## Zarhan

Your network administrator has pretty much misconfigured network then. You can't have longer prefixes than 64 bits or you are going to break things. Tell him to use a /64 instead.

----------

## MorpheuS.Ibis

the protocol is designed to support any prefixes, not just 64

the prefix length is chosen by design (matches allocated IPv4 subnet size, which simplifies mapping between v4 and v6 addresses), no way in changing that

things like non-working autoconfiguration is a not an issue here as this network is not designed to be plug-and-play, quite the opposite - you must have a matching IP/MAC address pair or nothing will work, not to mention 802.1x authentication

----------

## Zarhan

If you don't want autoconfiguration, then would you be using DHCPv6 in the first place?-)

Anyway, if you want to debug, just install Wireshark and see what kind of RA's are you getting. Although if the link type is Ethernet, I doubt any standard router will advertise prefixes with bigger length than /64.

----------

## MorpheuS.Ibis

by autoconf I meant mac-based address, not DHCPv6

RAs are looking right, with prefix info containing correct prefix length, thay are issued by radvd on fBSD machine, not some home router

I have since found out that ISC dhclient (version 4 and above) sets prefix to 64, as there is no way to determine prefix length from DHCP reply, and probably no (preferably UNIX-universal) way of getting a list of advertised prefixes from the kernel. is this true/probable/possible?

----------

## xibo

that is interresting. i have dibbler's dhcp server and clients, using a /119 prefix which works here. i can't get RADVD to send /119 prefixes though as it keeps telling me my net should be /64.

----------

## MorpheuS.Ibis

 *xibo wrote:*   

> that is interresting. i have dibbler's dhcp server and clients, using a /119 prefix which works here. i can't get RADVD to send /119 prefixes though as it keeps telling me my net should be /64.

 

could you send your dibbler server config? and radvd config? it should work with any prefix, as long as autoconf flag is disabled (otherconf = dhcp can be enabled)

----------

## xibo

 *server.conf wrote:*   

> 
> 
> log-level 8
> 
> log-mode long
> ...

 

 *radvd.conf wrote:*   

> 
> 
> interface eth5
> 
>  {
> ...

 

so far, 63 clients managed to get an address via dhcp, which would come close to the number of linux, mac os and legitime windows os users in my network ( even though a lot of hosts are in my net, most of them run pirated copies of windows xp sp1 ). for the prefix to be set correctly, the (dibbler) clients need to use something like

 *client.conf wrote:*   

> 
> 
> experimental
> 
> iface "eth1"
> ...

 

----------

## MorpheuS.Ibis

disable AdvAutonomous in radvd, if it is still complaining about non-/64 prefix

have you checked alny client computer? in my case I get the correct address from DHCP, and set the correct route from RA, bud the address is set with prefix /64 resulting in an incorrect "link-local" route

EDIT: OK, addr-params option seems to be a way to configure a prefix using DHCP, but is not standardized (and redundant, as RA should do that)

----------

## xibo

i have diabled advAutonomous, and now i'm not getting the warnings any more. thanks.

i am getting the correct prefix. are you using ia{ addr-params } ?

 */sbin/ifconfig wrote:*   

> 
> 
> eth1      Link encap:Ethernet  HWaddr 00:0e:0c:01:b9:dc  
> 
>           inet addr:134.60.104.16  Bcast:134.60.104.255  Mask:255.255.255.0
> ...

 

EDIT: just checked a Windows 2008 box; it's getting the DNS and NTP Servers via DHCPv6, but not getting an Address at all. I'll try adding a static address to it's DUID and see if that works next...

EDIT#2: oups, didn't see your edit.Last edited by xibo on Wed Jul 28, 2010 10:21 pm; edited 1 time in total

----------

## MorpheuS.Ibis

no, I am not, as the server is ISC dhcp and does not support sending addr-params (I tried, doesn't work)

the administrator said that RA is the way to get a prefix, not some DHCP extensions

from what I heard win7 boxes work OK, even with "crazy" prefixes

----------

## xibo

i haven't tryed inet6 prefixes, but i noticed windows not supporting "crazy" inet4 prefixes/masks.

the prefix should be set by the process that defines the routing table. in inet4 that was dhcp by using `option routers`, which is not present in inet6 dhcp. 

i think dibblers extention is provided to promote intranet environments to not use RAs, as inet6 is probably used in alot of places where it's actually not routed thanks to lack of support by the ISPs.

----------

