Page 1 of 1

Iptables restore

Posted: Thu Nov 08, 2012 9:28 am
by Piminiuser
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?

Re: Iptables restore

Posted: Thu Nov 08, 2012 1:47 pm
by tedhale
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

Re: Iptables restore

Posted: Thu Nov 08, 2012 5:28 pm
by Piminiuser
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..

Re: Iptables restore

Posted: Thu Nov 08, 2012 8:29 pm
by tedhale
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

Re: Iptables restore

Posted: Thu Nov 08, 2012 9:09 pm
by Piminiuser
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.