SIDEBAR
»
S
I
D
E
B
A
R
«
tinc IPv6 VPN router on a Raspberry Pi – part three
Jan 18th, 2015 by Anders Kringstad

As promised in my last post about the tinc IPv6 VPN router on Raspberry Pi I’ll provide cut-and-paste setup instructions to get the setup off the ground. I have used Ubuntu 14.04.l LTS to create this howto, but most other Debian-based distributions will work for this, and most other distributions also carry the tinc package.

Prepared requirements to complete this howto is:
a) One installed virtual or physical server with dualstack IPv4 and IPv6 connectivity to the Internet without port filtering. (Must be added after installation is done).
b) Static IPv6 addressing with atleast one static address (eth0) and two /64 networks routed to this address.
c) An Raspberry Pi with an Raspbian installed.
d) The Nordic Semiconductor (Bluetooth Smart) Raspbian 6LoWPAN-enabled 3.17.4+-release Linux kernel image package downloadable from their devzone site (direct download link: here)

Note: Please replace the IPv4 and IPv6 example networking with your own networks as needed in the following configuration examples. To get this working you need to know that the eth0 interface of the router has the IPv6 address 2001:0db8:85a3:a1a1::1/64 facing the Internet and the IPv6 network 2001:0db8:85a3:ef00::/56 routed to it. The virtual interface running the v6router has the /56 prefix routed to it locally and does the routing for it’s clients on the “inside” of this interface virtually.

On your server carry out the following steps to get tinc installed and ready for action:

aptitude install tinc
echo "v6router" >> /etc/tinc/nets.boot
mkdir -p /etc/tinc/v6router/hosts
cd /etc/tinc/v6router
cat <<EOT >> /etc/tinc/v6router/tinc.conf
Name = v6router
Mode = switch
EOT
cat <<EOT >> /etc/tinc/v6router/tinc-up
#!/bin/sh
# Enable tinc - add things
ip link set $INTERFACE up
ip -6 addr add 2001:0db8:85a3:ef00::1/64 dev \$INTERFACE
ip -6 route add 2001:0db8:85a3:ef00::/56 dev \$INTERFACE

# Static routing table - five client networks
ip -6 route add 2001:0db8:85a3:ef11::/64 via 2001:0db8:85a3::11
ip -6 route add 2001:0db8:85a3:ef12::/64 via 2001:0db8:85a3::12
ip -6 route add 2001:0db8:85a3:ef13::/64 via 2001:0db8:85a3::13
ip -6 route add 2001:0db8:85a3:ef14::/64 via 2001:0db8:85a3::14
ip -6 route add 2001:0db8:85a3:ef15::/64 via 2001:0db8:85a3::15
EOT
chmod +x /etc/tinc/v6router/tinc-up
cat <<EOT >> /etc/tinc/v6router/tinc-down
#!/bin/sh
# Disable tinc - remove things

# Static routing table - remove routes for clients
ip -6 route del 2001:0db8:85a3:ef11::/64 via 2001:0db8:85a3::11
ip -6 route del 2001:0db8:85a3:ef12::/64 via 2001:0db8:85a3::12
ip -6 route del 2001:0db8:85a3:ef13::/64 via 2001:0db8:85a3::13
ip -6 route del 2001:0db8:85a3:ef14::/64 via 2001:0db8:85a3::14
ip -6 route del 2001:0db8:85a3:ef15::/64 via 2001:0db8:85a3::15

# Disable tinc - remove routes and interface
ip -6 route del 2001:0db8:85a3:ef00::/56 dev \$INTERFACE
ip -6 addr del 2001:0db8:85a3:ef00::1/64 dev \$INTERFACE
ip -6 link set \$INTERFACE down
EOT
chmod +x /etc/tinc/v6router/tinc-down
cat <<EOT >> /etc/tinc/v6router/hosts/v6router
Address = 10.0.0.1
Subnet = 2001:0db8:85a3:ef00::1/128
EOT
tincd -n v6router -K4096
echo "net.ipv6.conf.all.forwarding = 1" >> /etc/sysctl.conf

Now, we should repeat this process on the Raspberry Pi, slightly modified, as we should not set up as much networking here as on the central router. Here are the commands to copy-and-paste for your Pi after logging in as root (yes, we require Internet access for this):

apt-get install tinc
mkdir -p /etc/tinc/v6router/hosts
cd /etc/tinc/v6router
cat <<EOT >> /etc/tinc/v6router/tinc.conf
Name = node-one
Mode = switch
ConnectTo = v6router
EOT
cat <<EOT >> /etc/tinc/v6router/tinc-up
#!/bin/sh
ip link set \$INTERFACE up
ip -6 addr add 2001:0db8:85a3::11/64 dev \$INTERFACE
ip -6 route add default via 2001:0db8:85a3::1 dev v6router
EOT
chmod +x /etc/tinc/v6router/tinc-up
cat <<EOT >> /etc/tinc/v6router/tinc-down
#!/bin/sh
ip -6 route del default via 2001:0db8:85a3::1
ip -6 addr del 2001:0db8:85a3::11/64 dev \$INTERFACE
ip -6 link set \$INTERFACE down
EOT
chmod +x /etc/tinc/v6router/tinc-down
cat <<EOT >> /etc/tinc/v6router/hosts/node-one
Subnet = 2001:0db8:85a3::11/128
EOT
tincd -n node-one -K2048

You now need to copy the file /etc/tinc/v6router/hosts/v6router from your central server to the node-one Raspberry Pi and place the contents of it in the exactly same file on the Pi. Then copy the contents of the file /etc/tinc/v6router/hosts/node-one from your Raspberry Pi to the same file on the central server.

If you would like your Raspberry Pi to automatically connect to the v6router on power-on you should add one more set of commands to it:

cat <<EOT >> /etc/tinc/nets.boot
v6router
EOT

You should now reboot your v6router server and make sure that it displays a virtual interface named v6router when done, it should look something like this:

v6router Link encap:Ethernet HWaddr c0:ff:ee:c0:ff:ee
         inet6 addr: fe80::50c0:35ff:eec0:ffee/64 Scope:Link
         inet6 addr: 2001:0db8:85a3::1/64 Scope:Global
         UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:500
         RX bytes:0 (0 MB) TX bytes:0 (0 MB)

Now reboot your Raspberry Pi and see if it’ll respond back to you with a ping on it’s IPv6 address. If you get a ping reply you are set for the last part that we’ll do in part four: – Getting the Raspberry Pi to connect devices on it’s local network with the routed IPv6 subnet.

tinc IPv6 VPN router on a Raspberry Pi – part one
Jan 16th, 2015 by Anders Kringstad

In December 2014 I had the opportunity to work with Nordic Semiconductor (Nordic) on a consultancy project aimed to equip their sales team with a demonstration kit that allowed Bluetooth Smart technology (Bluetooth low energy devices) to talk to services on the Internet using IPv6.

2015-01-16-nRF51-IPv6-connectivity-trThe problem Nordic faced is that one can not know what kind of network you will be presented with when doing a demonstration and most networks are set up with only IPv4 RFC1918 local network addressing with NAT and one public IPv4 address on the outside (WAN) before you reach the Internet. There is close to zero native IPv6 connectivity in most venues, hence, you need to do some level of tunnelling / VPN to get IPv6 onto your kit that talks IPv6.
The do and do-not.
Before I was invited to the project Nordic had already started out with the basic idea that a broad band router with dual stack IPv4/IPv6 connectivity could cater for this with a Raspberry Pi on it’s local WLAN or wired LAN. The Raspberry Pi would then allow the Bluetooth devices to connect to it through the bluetooth network interface using the 6LoWPAN technology that recently has emerged in kernel space (starting with the Linux kernel series 3.17).

However, we quickly became aware of the issues with such broadband routers: Their IPv6 capabilities exist on paper, but for the most, are rather often than not, badly implemented or even tacked onto the software part of the devices after initial design is done. Opening an web browser talking to your broadband router will mostly give you menus saying things like “Network => WAN, WLAN, LAN” and at the very end of the row of other tabs like “Security” and “Administration” you get this new one.. “IPv6”. Right.

Disappointed with the sorry state of technology at this stage I went back home and thought about how to do things properly. “Properly” in this context must be, I thought, some kind of device that always will try to connect to the Internet and present you with an IPv6 connection you can share with devices on your LAN, no matter what state the local network is in. I used Google. I used IRC, I talked to other skilled people on the phone and took a long walk.

Enter tinc
Then I found this project called “tinc”. The tinc VPN website says this about the software:
“Tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and encryption to create a secure private network between hosts on the Internet. Tinc is Free Software and licensed under the GNU General Public License version 2 or later. Because the VPN appears to the IP level network code as a normal network device, there is no need to adapt any existing software. This allows VPN sites to share information with each other over the Internet without exposing any information to others.” Tinc uses private/public keys to authenticate all nodes in a VPN and can therefore cater for incoming clients without static endpoints (e.g. static IPv4/IPv6 connectivity) as long as the router has both a IPv4 and IPv6 address with static connectivity.

I decided to give tinc a run. I then remembered the request from Nordic that the Raspberry Pi was to be the device connecting things to the router and then to the Internet. I researched the Raspbian (Debian based operating system to run on Raspberry Pi devices) software repositories and happily discovered that tinc was already packaged for Debian and had made it’s way into the Raspbian repositories as well.

Basic connectivity – the Raspberry Pi, you and the Internet
Connecting to the Raspberry Pi from your computer has always been the main problem for people trying to explore the device and it’s usage. To be able to talk to the device directly from your computer you could give it a LAN IPv4 address and talk to it directly by your computer LAN port. Most modern computers automatically cross their RJ45-ports so that devices can be connected directly. Thus, you can use your computer as a gateway for the Raspberry Pi and onto your WLAN and the Internet.

This is quite easily done using the howto at http://www.penguintutor.com/linux/raspberrypi-headless or similar pages. However, to be able to always have the option to connect by LAN to the Pi you would need to modify the howto a bit. Do as the howto says, but at the stage describing the interfaces file, modify so that you use the following entries:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
iface eth0:1 inet static
	address 192.168.1.6
        netmask 255.255.255.0
        gateway 192.168.1.1

By all means, edit the above to reflect your your local network requirements. The idea here is that the eth0 (wired Ethernet) interface on the Pi will always try to get an DHCP IPv4 address from a DHCP-server on the network it is connected to, but you will by the same time also have a eth0:1 interface defined with a static IPv4 RFC1918-address that allows you to directly plug your Pi into your computer network port and after editing your own LAN configuration to match the above network for eth0:1 (use any other address than .0, .1, .6 and .255) you will be able to SSH into your Pi.
If you do not have a switch that you can connect your Pi to, this is the way to do it. After this, your computer is connected to the Pi and you can access it in headless mode with SSH. If you also happen to run Linux and use a WLAN for your Internet access you can follow these steps to act as a NAT router for your Pi and give it Internet access:

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward

With this setup in place you can now download software from the Internet to your Raspberry Pi, and make it a node in a tinc VPN network. In part two we will look at setting up the two critical pieces of software – the tinc VPN router (on a separate dual stack machine/server on the Internet) and the tinc VPN router software on the Raspberry Pi.

Re: Who governs the Internet?
May 26th, 2011 by Anders Kringstad

Diplo Foundation: Internet Governance anno 2004©
After posting my previous ramblings on the subject of Internet Governance (IG) I’ve been quite busy in my head, thinking about where I stand on this subject and how best to define the various aspects of IG within the so-called «Nordic model» that applies to Government, Business and Citizen of Iceland, Norway, Sweden, Finland and Denmark (the Nordic countries). This time, I’m exploring parts of IG in the Nordics, as seen from Norway.

First of all, I’m not so sure that the Internet are seen in the same way in the Nordic region as a whole. I might be wrong, but Finland seem to be ahead of both Norway and Sweden, with Iceland and Denmark fast approaching from behind. Internet access is written into law as a citizen right in Finland and Sweden but not in the other countries (yet). With the United Nations pushing to make basic Internet access a human right (2003) and a renewal of this as a ‘fundamental right’ at the 2005 World Summit of the Information Society (WSIS) in Tunis, more countries are bound to make basic Internet access law for it’s citizen. In all the Nordic countries 80-95% of the population have access to the Internet on a daily basis if they wish to; at home, work/school or at Internet cafés, by cellphone et.c.

The WSIS Working Group (WG) on Internet Governance (WGIG), set up by the Secretary-General of the United Nations, after the first part of the WSIS in Geneva (2003) were asked to “investigate and make proposals for action, as appropriate, on the governance of the Internet by 2005″. Three defined issues represented the different objectives of the WG. One of these, “Develop a working definition of Internet Governance” are found in the report delivered by the WG:

“Internet governance is the development and application by Governments, the private sector and civil society, in their respective roles, of shared principles, norms, rules, decision-making procedures, and programs that shape the evolution and use of the Internet”[1]

In Norway the Government have for the past three-four years, to a degree, tried handed down the task of governing/policing the Internet from a juridical view, to private sector law companies and Internet providers, who for their part, are hard working not to become the ‘Norwegian Internet Police’ (NIP). I think that with the recent changes in policy and proposed laws in Norway we are likely to see a private sector NIP emerging quite quickly as providers of online services and access to Internet resources are required by law to police their users activities.

Let’s start with the part where many governments faulty  ‘Govern’ as ‘limiting access’:
As a technical somewhat technically oriented and policy-interested person I find it a bit hard to see a central governmental control of the Internet in Norway happen in a way that will hinder unwanted activities by citizens. The fact that it’ll be harder for ordinary citizen to carry out perfectly legal online activity and just as simple as before to do online criminal activity it’s enticing to see how many politicians of the western world see it as their job to implement digital restrictions on their subjects.

The ‘strike first’ policies with technical/digital hindering of negatively charged activities should certainly not be adopted in such a civilised country as ours? (Many people ask themselves this as the European Union have adapted the directive of data retention (“Directive 2006/24/EC”) Well?
Seen from a political view there is nothing wrong with creating digital walls that will hinder your subjects to do things not permitted by law. There’s only one problem here: We do not build such walls in our offline, physical society. There is no wall outside a nursery that will hinder a unscrupulous  individual taking pictures of the kids there. Nor is there someone taking notice on how many residence doors you approach, walk by or enter, and wish to use this information to decide if you’re a likely criminal.
Seen from a business view there is equally nothing wrong with having digital security in place and do a (technical part now, folks) package inspection on a content level (DPI) to make sure no corporate secrets are leaked. As long as this digital security is automatic, non-identifying of employees it’s for most people employed, ok. As many companies today have a set of rules for the use of computers and how to act online, what to access et.c. when representing the company/at work a little line or two about package inspection are probably being entered into the next rewrite of those rules.
I believe that it’s at work people are most likely to meet a page that tells them that ‘this part of the Internet is closed to you due to company policy’. This part of corporate culture and Information Security is a tipping point in peoples view of restriction of access. Regardless of company, there’s two camps here: Permissive or restrictive access. Restrictive access is of course the part with that incriminating page that tells you that /this/ is not something you should be doing at work. Working with permissive policies leaves the choices to the user, under the knowledge that the company might very well log their access, should something criminal happen down the road.
Seen from a residential view there is certainly something wrong with a paid-for Internet connection being monitored and logged for ‘future reference’ should something occur in your neighbourhood, or origin from the residential Internet connection that is not in line with local law. This rocks the very clear, and so far, unmovable principle that we are all equal to the law and are seen as innocent unless proven guilty.

So? Back to the main issue eh?
Who governs the Internet? It is clear through the definition by the WGIG[1] that the Internet is governed by a set of multi-stakeholders from three main parties, namely Government (G), Business (B) and Citizen (C). Within these there are a number of sub-representations such as Residential (R), Non-Governmental Organisations (NGO), Religious communities (R) et.al.
However, there is, even today, not a clear view of how to make sure that we are all equally treated in the scope of the Internet as a vital and more and more important part of our life. There have recently been great strides towards creating common ground for all, and this is certainly an evolving work on this, currently at the e-G8 and the G8-forum in France.

Right now I only see one thing as rock solid: As the Internet evolves the way it is governed will also evolve. What once was a academic research project have certainly come a long way since the 1960ies.

[1] Working definition of Internet Governance, published in the report from the Working Group on Internet Governance (WGIG), 2005, page 4

Defying the divide of “Internet access”, a starting point is needed
May 26th, 2011 by Anders Kringstad

As part of my eLearing assignment this week on Internet Governance there is a debate sparked about how to bridge the divide of having “Internet access”. I’ve been giving this a few moments of my time, and will use this entry, and comments on it/follow up posts, as part of my gaining of insight into the sub-subject of having Internet access.

Many countries have defined Internet access as an fundamental right, but they have, cleverly, not defined ‘how’ this access should be provided for, and if it is to cost their population money.

So, how does people get online in todays world?
In many countries basic Internet access is first established through the use of an mobile browser on ones cellphone.

After this, many, many, many people have access to the Internet through Internet cafés in their local community or through educational institutions or work.

Thirdly, residential Internet access is spreading in all parts of the world, with Europe, the Pacific region of Asia and the northern parts of America as the head of the pack.

Finding a solution that globally defines “basic Internet access” or “Internet access” is key to being able to bridge this divide for the future generations. To make that happen, we need the nations of the world to unite under a common definition that have been agreed on in a neutral fora.
The G8 or G20 is no such fora, nor is the EU or other regional foras of trade/governmental membership. The UN might be a starting point, but I’m not sure of the UN is right either.

Who governs the Internet?
May 22nd, 2011 by Anders Kringstad

Who governs the Internet? If asked this question, different people will answer very differently, shaped by their previous experiences, background, objectives and history in general.

Recently I started on an six month eLearning online course by the Internet Society titled “Shaping the Internet – History and Futures”. As the NGL programme web-page says: “The course curriculum covers the essential topics required for effective interactions and relationships within the Internet ecosystem, as well as key concepts and emerging issues in Internet governance”.

I’m absolutely thrilled to be on this and have a clear goal of delivering my absolutely best with participating in discussions, classes, doing my assigned activities and being available to my fellow course participants!

..back to the question asked. A Google-search will return what I’d say is a slim selection of responses. A quick read-through of some of the hits give a hint to the complexity of the issue. Some of them gives you pointers to the UN, the ITU, the Internet Society (ISOC) and of course, the World Summit of the Information Society (WSIS) in 2003/2005.
If you work in the private part of the ICT sector in a western country in Europe and you speak English as your primary or second language, you are probably going to find that the answers Google will return with, matches your views in many ways. But what if you work with the governmental ICT of an emerging economy in another part of the world, with a different language and a different set of rules in daily life? Will your answer be different?

With the NGL programme in my head and the Internet governance as an very interesting subject, I’m giving this a great deal of thought and will probably write more on this subject in the weeks ahead.

Now, where did I put my book of Roman warfare?

»  Substance:WordPress   »  Style:Ahren Ahimsa