Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
10 mai 2013 5 10 /05 /mai /2013 12:19

We'll have a quick guide to the Raspberry PI / RASPBIAN setup, with a special focus over IPv6. As well as a quick network admin guide to RASPBIAN.







Getting to know the RASPBERRI PI / RASPBIAN


The Raspberry PI houses an ARMv6 SOC. Raspbian is Debian based, adapted for the RPI ( Raspberry PI ) SOC, and compiled for it ( ARMv6 ).

The Raspbian image comes in the form of a .img file, that has to be 'sector-written ' to the SD card using a disk imager software.

Once the image file written, the SD card will contain 2 partitions :




The Firmware partition holds a software-firmware ( ie BIOS ), as there is no BIOS chip present on the RPI board.

At the time of this writing, the partition is 56 MiB in size ( 18 MiB filled )


The second partition holds the OS / Softwares and Documents.

At the time of this writing, the partition is 2.7 GiB in size ( 1.77 GiB filled )


Please note that the image needs to be expended, to be able to use the whole SD card capacity ( see installation )

At the time of this writing, on a 4GB Sd Card, 940 MiB unallocated.




We download the latest Raspbian image file (.img) + Win32DiskImager on http://www.raspberrypi.org/downloads

We flash the SDCard ( 4GB Minimum ) using Win32DiskImager ( No drag and drop ).

We start the RPI

( Default login = pi / raspberry )




First Setup

at first startup, the initial setup menu is automatically launched :




1. We set Internationalisation Options:

    . TimeZone

    . Keyboard    ( 105 keys intl / your country / all defaults )

2. We Change User Password

3. We Expand Filesystem


4. Finish


5. We reboot the RPI :

sudo reboot



Here are the important commands to know :

startx                                      ( to launch the Desktop Environment )

sudo reboot                         ( to reboot the RPI )

sudo shutdown -h now      ( to shutdown the RPI. Wait, and unplug finally )

sudo raspi-config                ( to relaunch the initial setup menu )



Editing configuration files of the RPI


With the Raspberry PI ( as well as other Linux Distros ), most configuration tasks can be performed using the command line, without the need to enter the graphical desktop environement ( LXDE ).
Furthermore, we need root rights to edit system files, so in Desktop mode, we have to launch a command prompt, to launch a text editor with root rights.

As an exemple, to edit the file /etc/network/interfaces, there are two ways :

without Desktop Environment :

sudo nano /etc/network/interfaces                                               ( use CTRL+X to save changes )


with Desktop Environment :

launch command line and type :

    sudo leafpad /etc/network/interfaces

do note that as a consequence of the command line being so powerfull, we can perform most setup tasks using telnet ( SSH ).




Static Network Setup of the Raspberry PI Raspbian

We edit /etc/network/interfaces :

( sudo leafpad /etc/network/interfaces )


and replace the ' iface eth0 inet dhcp ' line with :

iface eth0 inet static

to display the file using command line :
cat /etc/network/interfaces

reboot to apply changes ( sudo reboot )



Network verification

ifconfig        ( Linux equivalent to ipconfig )


DNS setup


We edit /etc/resolv.conf :

( sudo nano /etc/resolv.conf )

and add nameserver entries. ex :


to verify :

cat /etc/resolv.conf

We reboot to apply changes ( sudo reboot )

DNS test

we need the package dnsutils for nslookup and dig commands :

sudo apt-get update

sudo apt-get install dnsutils

and we then test DNS resolution :

ping www.wikipedia.org

nslookup www.wikipedia.org

time sync verification

The Raspberry PI has no hardware RTC ( Real Time Clock ).
Time is setup using internet NTP server. To check the sync is working ok we can use the ' date ' command.


Static IPv6 setup




The IPv6 Module is not loaded by default. To load it temporary :

sudo modprobe ipv6    ( temporary effect )

To set it up to be automatically loaded at each boot, we need to edit the /etc/modules file :

sudo leafpad /etc/modules

we just add ipv6 on a line by itself at the end of /etc/modules

sudo reboot

How to disable SLAAC on the RPI

As we're doing static networking, we will disable SLAAC. We need to edit /etc/sysctl.conf :

sudo nano /etc/sysctl.conf

and add this line :
( net.ipv6.conf.eth0.autoconf=0 may eventually be needed too to erease any previous setup )



IPv6 and DNSv6 Addresses setup


we setup static IPv6 addresses, by adding some lines in /etc/network/interfaces :

sudo leafpad /etc/network/interfaces

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

we add the DNSv6 addresses by editing /etc/resolv.conf :

sudo nano /etc/resolv.conf

we add nameserver entries. ex :

nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844

to verify :

cat /etc/resolv.conf

we reboot to apply changes ( sudo reboot )

IPv6 tests


ping6 www.wikipedia.org
traceroute6 www.wikipedia.org

to force the use of a particular DNS server with nslookup ( ex to force DNSv6 resolution ) :


nslookup www.wikipedia.org [IPv4 DNS]
nslookup www.wikipedia.org [IPv6 DNS]

( it's the same as Windows nslookup )

( All complete /etc/interfaces and /etc/resolv.conf files will be provided at the bottom of this post as an exemple ).

Raspbian Network Notes

a more windows style tracert :

sudo traceroute -I www.wikipedia.org

to check routes :

ip route show

ip -6 route show

Please do note that no additional route creations are needed here for complete IPv4/IPv6 Internet connectivity.




SSH remote access using Windows


Telnet SSH is allowed by default, on port 22.

We just need to install Putty


and fill these settings :


[RPI IP] / Port ( 22 Default ) / SSH




Raspbian remote access using the Native Windows RDP Client

Raspbian Setup :

sudo apt-get install xrdp

sudo reboot

Windows OS :

we just use Windows Remote Desktop Connection and login using the RPI IP ( no user )

    we're then asked for our RPI credentials



To log out, we need to use the bottom-right red buttom on the Raspbian LXDE desktop




Raspbian Wireshark Install ( with non-root user limited privileges )

The right way to install Wireshark is with non-root user limited privileges ( the other way being to launch it fully root, which is not a good idea. Or ending unable to capture on the interfaces ).

It's very simple actually :


sudo apt-get install wireshark

dpkg-reconfigure wireshark-common

    ( answer YES )

sudo usermod -a -G wireshark pi

logout / login ( to apply permissions changes )




Keeping Raspbian Updates

To Update the Raspbian OS and the installed packages :


sudo apt-get update

sudo apt-get upgrade



To update the Firmware ( ie BIOS )


sudo apt-get update

( ' sudo apt-get install rpi-update ' if needed)

sudo rpi-update



Raspbian Command Line


Here are some basics bash commands :



cd                                                    change directory

ls                                                     list directory content

cp                                                    copy file

mv                                                   rename file

rm                                                   delete file


grep nameserver /etc/resolv.conf                                                      looks for the string ' nameserver ' in the file resolv.conf

grep -i nameserver /etc/resolv.conf                                                   the same as above, not case sensitive


cat /var/log/messages                 lists the system log file

dmesg log                                      full log

uname -a                                        displays the kernel version



Partager cet article

Repost 0
Published by computer outlines - dans IPv6
commenter cet article



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