Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DHCPv6: Client uses prefixlen 128
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 378

PostPosted: Sat Aug 01, 2020 12:58 pm    Post subject: DHCPv6: Client uses prefixlen 128 Reply with quote

Hi All.

For my home network i'm settings up DHCPv6 to assign fixed IPv6 addresses to some clients. It works but doesn't do exactly what i want. After DHCP this is how the client is configured:
Code:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.21.64  netmask 255.255.255.0  broadcast 192.168.21.255
        inet6 fe80::9824:4bef:XXXX:XXXX  prefixlen 64  scopeid 0x20<link>
        inet6 2001:XXXX:XXXX:XXXX::64  prefixlen 128  scopeid 0x0<global>
        ether 80:fa:5b:27:98:8a  txqueuelen 1000  (Ethernet)
        RX packets 9  bytes 1084 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 25  bytes 2338 (2.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The 2001:.... address is assigned by my DHCP server, note the prefixlen 128, while the correct value should be 64. As result of this the dhcp client can't reach any hosts on the same IPv6 subnet.

Server side i'm running net-misc/radvd-2.18 and net-misc/dhcpd-4.4.2-r2.

/etc/radvd.conf is:
Code:

interface eth1.21 {
 AdvSendAdvert on;
 AdvManagedFlag on;
 AdvOtherConfigFlag on;
 prefix 2001:XXXX:XXXX:XXXX::/64 {
  AdvAutonomous off;
  AdvRouterAddr on;
 };
};


/etc/dhcp/dhcpv6.conf is:
Code:

ddns-update-style none;
authoritative;

subnet6 2001:XXXX:XXXX:XXXX::/64 {
  range6 2001:XXXX:XXXX:XXXX::64 2001:XXXX:XXXX:XXXX::64;
  range6 2001:XXXX:XXXX:XXXX::/64 temporary;

  option dhcp6.name-servers 2001:XXXX:XXXX:XXXX::1;
  default-lease-time 2592000;
  max-lease-time 2592000;

  host pc15 {
   host-identifier option dhcp6.client-id 00:01:00:01:1e:XX:XX:XX:XX:XX:XX:XX:XX:XX;
   fixed-address6 2001:XXXX:XXXX:XXXX::64;
  }
}


Does anyone know how to fix this?

Thanks in advance.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6795
Location: Blighty

PostPosted: Sat Aug 01, 2020 3:24 pm    Post subject: Reply with quote

DHCPv6 only assigns an address, which is a /128.
The only time it assigns a /64 is when you use Prefix Delegation, which is designed to be used on a router.
You need to use Router Advertisements still to broadcast the /64 prefix, which the /128 address for it will use.
You should be able to see the /64 prefix route using `ip -6 r`
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 378

PostPosted: Sun Aug 02, 2020 2:07 pm    Post subject: Reply with quote

Thanks for your reply UberLord, you are right, there is a route for the local subnet and the client can reach it's local subnet.
I would have preferred the client to just configure the right subnet on the interface, so no prefix delegation, just use the correct prefix length for the subnet it's in. I guess it works this way because of the split responsibility between radvd and dhcpd, and because i focused on the interface configuration i totally missed the fact the route is there.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6795
Location: Blighty

PostPosted: Sun Aug 02, 2020 4:03 pm    Post subject: Reply with quote

Right. Because DHCPv6 doesn't care about the prefix, the prefix itself could be of any length and still work.
Only SLAAC cares about it being /64.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum