Skip to content

Instantly share code, notes, and snippets.

@jimyang2008
Last active June 12, 2019 07:21
Show Gist options
  • Save jimyang2008/c727f3250b4fbf864dcccd66840e9939 to your computer and use it in GitHub Desktop.
Save jimyang2008/c727f3250b4fbf864dcccd66840e9939 to your computer and use it in GitHub Desktop.
Raspberry Pi

Notes on Raspberry Pi

Initial default username password for Raspbian

username: pi
password: raspberry

Update Locale to support "US"

Need to add US support in addition to default GB, including language, keyboard, etc.

$ raspi-config

ipv6

References

Set a static ipv6 address for interface connecting to LAN(provides ipv6 network prefix)

In order to set static ipv6 address in Raspberry Pi, we have to upgrade DHCPCD5 to support static ipv6 address. To set ipv6 static address, dhcpcd5 need to be upgraded to a version no less than 6.10.2.

NOTE: Although the binary is /sbin/dhcpcd, the package is dhcpcd5 rather than dhcpcd !! (Refer to this page for dhcpcd5)

$ sudo apt-get upgrade dhcpcd5

Then it can configure static ipv6 address like this

static ip6_address=fd00:1:1:1::1/64
$ cat > /etc/dhcpcd.conf <<EOS
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier
slaac private
interface eth1
static ip_address=192.168.2.1/30
static ip6_address=2001:db8:1:ffff::1/64
static domain_name_servers=8.8.8.8 2001:4860:4860::6464
EOS

Configure DNSMASQ service for DHCP and DNS

$ apt-get install dnsmasq
$ cat > /etc/dnsmasq.conf <<EOS
domain-needed
bogus-priv
server=2001:4860:4860::6464
except-interface=eth0
bind-interfaces
domain=fw.lan
dhcp-fqdn
enable-ra
dhcp-option=option6:dns-server,[2001:4860:4860::6464]
dhcp-authoritative
dhcp-mac=set:client_is_a_pi,B8:27:EB:*:*:*
dhcp-reply-delay=tag:client_is_a_pi,2
interface=eth1
listen-address=127.0.0.1,192.168.2.1
dhcp-range=192.168.2.2,192.168.2.2,10h
dhcp-range=::100,::1ff,constructor:eth1
EOS

Configure TAYGA for NAT64

$ sudo apt-get install tayga
$ cat > /etc/tayga.conf <<EOS
tun-device nat64
ipv4-addr 192.168.255.1
prefix 2001:db8:1:ffff::/96
dynamic-pool 192.168.255.0/24
data-dir /var/spool/tayga
EOS
$ vi /etc/default/tayga
# set RUN="yes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment