Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
29 juin 2013 6 29 /06 /juin /2013 09:31

We'll see here how to setup the Raspberry PI as a DHCPv6 client and server, using wide-dhcpv6,
with configuration files exemples.

Please see previous post for DHCPv6 theory ( DUID, IAID, ... )

 

 

 

RaspberryPI DHCPv6 client setup

D4a.gif

 

First we disable SLAAC :

sudo nano /etc/sysctl.conf :

#net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.autoconf=0
net.ipv6.conf.eth0.autoconf=0

nb : net.ipv6.conf.eth0.autoconf=0 might be needed to erease a previous setup. Use it if needed


We install the Wide-DHCPv6-Client :

sudo apt-get install wide-dhcpv6-client

at installation, the listenning interfaces are requested. We choose eth0 in this case

 

We edit the configuration file :

sudo nano /etc/wide-dhcpv6/dhcp6c.conf :

interface eth0{
  send ia-na 0;
  request domain-name-servers;
  script "/etc/wide-dhcpv6/dhcp6c-script";
};

id-assoc na 0 {
};


We reboot the Raspbian OS

A few explainations about this config file :

interface eth0{ ... };                                                   defines settings for eth0

  send ia-na 0                                                           sets IAID 0 for this interface
  request domain-name-servers                          request DNS IPs
  script "/etc/wide-dhcpv6/dhcp6c-script"            copies the DNS IPs in /etc/resolv.conf 

id-assoc na 0 { };                                                     needed stanza



for reference, here is the /etc/network/interfaces file for the interface eth0 to behave DHCPv4/DHCPv6 client :

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Firewall settings


We have to remember to allow in DHCPv6 answers if the firewall is too restrictive :

ip6tables -A INPUT -s FE80::/10 -p udp --dport=546 -j ACCEPT


Raspbian with 2 DHCPv4/DHCPv6 listening interfaces

While rarely usefull, this configuration is interesting to outline. It does brings some
subtlelties into light :

First, be sure to install wide-dhcpv6-client and to select both interfaces at the initial setup : eth0 eth1
( Or do rpkg ). Forgetting to do this will have the unregistered interface not listening.

here is the dhcp6c.conf file :

# Default dhpc6c configuration: it assumes the address is autoconfigured using
# router advertisements.


interface eth0{
  send ia-na 0;
  request domain-name-servers;
  request domain-name;
  script "/etc/wide-dhcpv6/dhcp6c-script";
};

interface eth1{
  send ia-na 1;
  request domain-name-servers;
  request domain-name;
  script "/etc/wide-dhcpv6/dhcp6c-script";
};

id-assoc na 0 {
};

id-assoc na 1 {
};

 

 

This is how we setup the IAIDs, one per interface
Here is the /etc/network/interfaces file :

auto lo

iface lo inet loopback
iface eth0 inet dhcp
iface eth1 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp


Finally here is an extract of sysctl.conf :

# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.autoconf=0
net.ipv6.conf.eth1.autoconf=0
net.ipv6.conf.eth0.autoconf=0


( the last two lines may be needed, if the previous settings don't want to discard ).

 

 

 

Raspbian as a DHCPv6 Server

 

( actually under redaction )

 

Partager cet article

Repost 0
Published by computer outlines - dans RASPBERRY PI
commenter cet article

commentaires

Présentation

  • : Computer Outlines Blog
  • : Blog mainly focused over IPv6, Windows Server, and Networking in general.
  • Contact

Recherche

Liens