# IPSEC/L2TP VPN on a Raspberry Pi running Arch Linux

DevFeed: [IPSEC/L2TP VPN on a Raspberry Pi running Arch Linux](<https://devfeed.tech/articles/ipsec-l2tp-vpn-on-a-raspberry-pi-running-arch-linux-25393.md>)

Original publisher: [Read original article](<https://smileykeith.com/2014/01/27/ipsec-l2tp-vpn-on-a-raspberry-pi-running-arch-linux/>)

Author: Keith Smiley

Published: 2014-01-28T04:49:00Z

Content type: tutorial

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [Virtual Private Network](<https://devfeed.tech/topics/vpn.md>), [Arch Linux](<https://devfeed.tech/topics/archlinux.md>), [Raspberry Pi](<https://devfeed.tech/topics/raspberry-pi.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [Arm](<https://devfeed.tech/topics/arm.md>), [Firewall](<https://devfeed.tech/topics/firewall.md>), [pacman](<https://devfeed.tech/topics/pacman.md>), [Script](<https://devfeed.tech/topics/script.md>), [systemd](<https://devfeed.tech/topics/systemd.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [arm](<https://devfeed.tech/tags/arm.md>), [article](<https://devfeed.tech/tags/article.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [firewall](<https://devfeed.tech/tags/firewall.md>), [ipv4](<https://devfeed.tech/tags/ipv4.md>), [linux](<https://devfeed.tech/tags/linux.md>), [pacman](<https://devfeed.tech/tags/pacman.md>), [raspberry-pi](<https://devfeed.tech/tags/raspberry-pi.md>), [script](<https://devfeed.tech/tags/script.md>), [systemd](<https://devfeed.tech/tags/systemd.md>), [vpn](<https://devfeed.tech/tags/vpn.md>)

## AI overview

This tutorial explains how to configure an IPsec/L2TP VPN on a Raspberry Pi running the ARM version of Arch Linux. It covers installing the required packages, configuring firewall rules and redirects, and creating a systemd-launched script so the configuration persists after restart.

## Source excerpt

After you buy a Raspberry Pi, or two, you need to figure out what to use them for. While you'll get a ton of interesting ideas from Googling "uses for a Raspberry Pi," I didn't particularly find them any more than a thought exercise. Making a VPN stood out as an actually useful configuration. Originally when I got my (accidentally chosen) Model A, I spent a little while going through this guide using Raspbian. That seemed to work fine until I recently purchased a Model B to replace it and couldn't reproduce the configuration. I decided to write the steps that I was finally able to use to get a functional VPN running on Arch Linux. I started out by following this guide hoping that it would get me a functioning VPN without too much work. Most of this setup will be based on that article with some tweaks for what I had to do to make the settings stick. Unfortunately while it worked after the setup the configuration did not persist after restart. For this configuration, like I said earlier, I wanted to use the ARM version of Arch Linux rather than Raspbian for the install. You can download the Raspberry Pi compatible Arch image from their downloads page. I'm not sure I would recommend Arch for people who haven't installed it before or at least gotten through their Beginners' Guide. The ARM Image, like the normal image, doesn't come with a GUI, perfect for this use of the Pi. I'm not going to bother with making sure this works before restarting, since that doesn't seem like much of an issue with actual usage (although you can just run the scripts we create and it should work fine). I wouldn't recommend doing much configuration before doing this intial setup. I did this the first time and after an hour of configuration my VPN did not work correctly, I ended up nuking the work I had done and starting over. Start by installing the necessary components: pacman -Sy openswan xl2tpd ppp lsof python2 You need to do some configuration of the firewall and redirects: echo "net.ipv4.