Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Iptables restore

Thu Nov 08, 2012 9:28 am

Hi, i just turned my raspberry pi into a open-vpn server 8-). Also i had to add 2 rules in the iptables thing.

Now everytime i reboot the rasberry pi, i need to create the 2 rules again. It wont auto-load when the rasperry pi starts. How can i do that?

And i have the 512 mb version (4g) and i am running 2012-10-28-wheezy-raspbian, do i have automatic 512 mb ram, or must i do a trick to get 512 mb instead of 256?

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Iptables restore

Thu Nov 08, 2012 1:47 pm

Just put the two iptables commands into
/etc/rc.local
and they will be run at the end of the boot up process.

I use an ubuntu system as a firewall with extensive iptables rules ( a couple hundred or so)
I created a firewall script that gets run from the init process and reads most of the setting from config files to make it easier to modify.
Something like that could be another option, but if it is just two rules and they won't be likely to change, then just put them in rc.local
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Iptables restore

Thu Nov 08, 2012 5:28 pm

tedhale wrote:Just put the two iptables commands into
/etc/rc.local
and they will be run at the end of the boot up process.
It's just for the 2 rulles. How to put the commands in /etc/rc.local ? Sorry for my noobness..

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Iptables restore

Thu Nov 08, 2012 8:29 pm

No problem. We expect noobs here. We were all there once.
I just wish that forums like this were around when I started years ago, but that was before the internet was very common.


Do this:
sudo nano /etc/rc.local

sudo makes the command run as root (required to edit this file)
nano is a text editor
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Iptables restore

Thu Nov 08, 2012 9:09 pm

It works!! I love you! Since i have my pi, i learnd a lot about linux. Just a biginner and i need to lean much. Following a lot of tutorials, sometimes i know what the commands mean, en sometimes i dont. Thnx for your help.

Return to “Beginners”