Overblog Suivre ce blog
Administration Créer mon blog
1 juillet 2013 1 01 /07 /juillet /2013 17:16

We will see here the SLAAC settings for Raspberry PI / Raspbian : Default Gateway, Default Gateway + SLAAC advertiser

Configuration files will be shown.

 

D7b.gif

 

 

RASPBIAN as a Default Gateway

 

 

For this setup, we want Raspbian 1 to advertise itself as a Default Gateway through RAs ( Router
Advertisements ), advertising hosts to request for a full DHCPv6 on the Subnet. Here is the network map :

 

D7a.gif

 

First we set static IPv6 Addresses for eth0 and eth1.
We allow routing and disable SLAAC autoconfiguration for the Raspbian :

sudo nano /etc/sysctl.conf :

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 line may be needed to erease previous configurations)

We install the radvd package :

sudo apt-get update
sudo apt-get install radvd

We edit the radvd config file :

sudo nano /etc/radvd.conf :

interface eth1 {
 AdvSendAdvert on;
 AdvManagedFlag on;
 AdvOtherConfigFlag on;
 MinRtrAdvInterval 3;
 MaxRtrAdvInterval 10;
 prefix 2001:db8:0:1::/64 {
  AdvOnLink on;
  AdvAutonomous off;
  AdvRouterAddr on;
 };
};

not much to comment about this configuration file :

RA advertisement is on                                 Raspbian do send RA

Managed + OtherConfig are on                   Client should request full statefull DHCPv6 on the

subnet

MinRtr + MaxRtr                                               Advertisement Timings

AdvOnLink on                                                  Raspbian precise he's on-link ( not

behind a router )

AdvAutonomous off                                        Clients should not perform SLAAC

autoconfiguration

AdvRouterAddr on                                           MAC address of the Rasbian is sent

 

 

RPI advertised as default gateway + SLAAC + Stateless DHCPv6 provider

D7b

Here we wish to have the Raspbian OS perform as a full Gateway :

. Advertise itself as a default gateway

. Send SLAAC autoconfiguration datas

. Send DNS Servers IPs + Domain name

First, we static IPv6 Addresses for eth0 and eth1.

We allow routing and disable SLAAC autoconfiguration for Raspbian interfaces :

the /etc/sysctl.conf file needs to contain this part :

#  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 line may be needed, to erease previous interfaces configuration )

We install the radvd package :

sudo apt-get update
sudo apt-get install radvd

We edit the radvd configuration file :

sudo nano /etc/radvd.conf :

interface eth1 {
 AdvSendAdvert on;
 AdvManagedFlag off;
 AdvOtherConfigFlag on;
 MinRtrAdvInterval 3;
 MaxRtrAdvInterval 10;
 prefix 2001:db8:0:1::/64 {
  AdvOnLink on;
  AdvAutonomous on;
  AdvRouterAddr on;
 };
};

It's the same as the previous example ( see for details ), except for the Managed and Autonomous

flags :

Managed flag is off, and Autonomous flag is on :

The host will autoconfigure its IPv6 addresses using SLAAC. Do note that because the OtherConfig flag

is on, hosts will send a DHCPv6 request for DNS / Domain name datas.

So we need to install the wide-dhcpv6-server package for this :

sudo apt-get install wide-dhcpv6-server

and create its configuration file :

sudo nano /etc/wide-dhcpv6/dhcp6s.conf

 

option domain-name-servers 2001:4860:4860::8888;
option domain-name "example.com";

interface eth1 {
};


( See previous posts for full explainations about the wide-dhcpv6 packages and Raspbian )

Do remember to take care of firewall rules, for the RAs and DHCPv6 requests to get in.

Finally, for precision, here is a static IPv6 configuration file :

cat /etc/network/interfaces


auto lo

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

iface eth0 inet6 static
address 2001:db8:0:0::240
netmask 64
gateway 2001:db8:0:0::1

iface eth1 inet6 static
address 2001:db8:0:1::1
netmask 64


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

 

 

RASPBIAN OS as a Default Gateway / SLAAC / RDNSS provider

 

[ to be written soon. A network component is needed ]

 

Repost 0
Published by computer outlines - dans RASPBERRY PI
commenter cet article
1 juillet 2013 1 01 /07 /juillet /2013 16:02

We will see here the settings for Raspberry PI / Raspbian as a SLAAC Client. Configuration files will be shown.

 

 

  D6a

 

RASPBIAN SLAAC / Stateless DHCPv6 Client

 

We will first see how to setup Raspbian OS as a simple SLAAC + Stateless DHCPv6 client.

Here is the network map used :

 

D6a

 

First, we setup /etc/sysctl.conf. It should contain these lines :

 

#  based on Router Advertisements for this host
net.ipv6.conf.all.forwarding=0
net.ipv6.conf.all.autoconf=1
net.ipv6.conf.eth0.autoconf=1

( the last line may be needed, to erease some previous settings )

 

We need a dhcpv6 client for the Stateless DHCPv6 requests :

 

sudo apt-get install wide-dhcpv6-client

 

The default config file doesn't need to be changed. It will request DNS and Domain name informations. To check it :

 

cat /etc/wide-dhcpv6/dhcp6c.conf

 

( to be added )

 

The default /etc/network/interfaces doesn't need to be changed either. Here is the default one :

 

cat /etc/network/interfaces

 

( to be added )

 

Finally, we need to remember to let RAs ( Router Advertisements ) in using ip6tables

 

 

RASPBIAN SLAAC / RDNSS client

 

Now let's see how to setup our RASPBIAN OS using SLAAC / RDDNS. The network map is :

 

 

D6a

 

First, we setup /etc/sysctl.conf. It should contain these lines :

 

#  based on Router Advertisements for this host
net.ipv6.conf.all.forwarding=0
net.ipv6.conf.all.autoconf=1
net.ipv6.conf.eth0.autoconf=1

( the last line may be needed, to erease some previous settings )

 

We need a RDNSS client for the RDNSS requests :

 

sudo apt-get install rdnss

 

The default config file doesn't need to be changed. It will append IPv6 DNS IPs to /etc/resolv.conf.

 

The default /etc/network/interfaces doesn't need to be changed either. Here is the default one :

 

cat /etc/network/interfaces

 

( to be added )

 

Finally, we need to remember to let RAs in ( Router Advertisements ) using ip6tables

 

There is an important point to look at :

 

Resolvconf only puts 3 records max in /etc/resolv.conf. As an exemple if you happen to have 3 DHCPv4 records advertised to the RASPBIAN OS ( because of dual NIC ) There won't be no place left for RDNSSD to register. one advertised DHCP DNS record as to be removed.

1st solution :

 

edit the resolvconf/interface-order to put rddnsd first :

 

sudo nano /etc/resolvconf/interface-order

and add as first line :

# interface-order(5)
*.rdnssd


2nd solution :

Remove one or two advertised DHCP DNS records from the RASPBIAN OS subnets.


RASPBIAN dual SLAAC client + RDNSS client

 

This third configuration is rarely usefull, but it brings some very interesting points into light. Here is the network map :

 

D6b

 

We wish to have Raspbian 1 request for a full SLAAC configuration via eth0 ( IPv6 addresses, default gateway, DNS server IPs ), and setup to use Internet Gateway as a default gateway via eth0.

We wish too to have eth1 to get too a SLAAC IPv6 address. We don't need to receive DNS IPs from Router 1/eth1, and don't want to have Router 1/eth1 registered as a default gateway.

 

First, we setup /etc/sysctl.conf. It should contain these lines :

 

#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.autoconf=1
net.ipv6.conf.eth1.accept_ra_defrtr=0
net.ipv6.conf.eth1.autoconf=1
net.ipv6.conf.eth0.autoconf=1

 

( the last two lines may be needed, to erease some previous settings )

Please note this line : net.ipv6.conf.eth1.accept_ra_defrtr=0 :

It prevents eth1 to register a default route, so we will only have one default route listed.

To check the IPv6 default routes registered by the RASPBIAN OS :

 

ip -6 route show

 

 

We need a RDNSS client for the RDNSS requests :

 

sudo apt-get install rdnss

 

The default config file doesn't need to be changed. It will append IPv6 DNS IPs to /etc/resolv.conf.

 

The default /etc/network/interfaces doesn't need to be changed either. Here is the default one :

 

cat /etc/network/interfaces

 

( to be added )

 

Finally, we need to remember to let RAs in ( Router Advertisements ) using ip6tables

 

Again we have the resolv.conf point to look at :

 

Resolvconf only puts 3 records max in /etc/resolv.conf. As an exemple if you happen to have 3 DHCPv4 records advertised to the RASPBIAN OS ( because of dual NIC ) There won't be no place left for RDNSSD to register. one advertised DHCP DNS record as to be removed.

1st solution :

 

edit the resolvconf/interface-order to put rddnsd first :

 

sudo nano /etc/resolvconf/interface-order

and add as first line :

# interface-order(5)
*.rdnssd


2nd solution :

Remove one or two advertised DHCP DNS records from the RASPBIAN OS subnets.


Repost 0
Published by computer outlines - dans RASPBERRY PI
commenter cet article
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 )

 

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

Présentation

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

Recherche

Liens