I followed the following tutorial http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing to create a Rpi vpn server. The main difference is the writer here has the eth01 interface set to dhcp and mine is set to static.

There is a part of the tutorial where you add a firewall rule file to /etc/network/interfaces. Since mine is static, it differs from the tutorial. When I try to add "pre-up /etc/firewall-openvpn-rules.sh" to this file, when I reboot my interface is not given an IP address.

I have tried adding it below "iface eth0 inet static" and also after "gateway" but either time the Rpi does not get an IP.

You can see the file contents here: http://pastebin.com/9313CDrm.

How do I go about getting this file added and get my Rpi to still receive it's static IP?

  • 1
    What happens when you execute the firewall script manually? Also run echo $? right after the script to check if the script returns 0 — if a pre-up script fails, the network interface will not be activated, which might well be the cause of your problem. – n.st May 11 '14 at 15:49
  • Good question. I am a Linux novice. Let me try and see what happens. – Shaxs May 12 '14 at 5:02
  • So I am not sure how to execute it. "sudo firewall-openvpn-rules.sh" ? Also, here is what is in that file: code #!/bin/sh iptables -t nat -A POSTROUTING -s -o eth0 -j SNAT --to-source – Shaxs May 12 '14 at 5:07
  • Well this might be it.. root@raspberrypi:/etc# ./firewall-openvpn-rules.sh bash: ./firewall-openvpn-rules.sh: /bin/sh : bad interpreter: No such file or directory – Shaxs May 12 '14 at 5:14
  • I used the command "which sh" and it returned back /bin/sh. So I am not sure what to do now. – Shaxs May 12 '14 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.