Linode Forum Index Linode Forum
Linode Community Forums
 


Step-by-step iptables configuration guide?

Click here to go to the original topic

 
       Linode Forum Index -> Linux Networking
Author Message
cthorpe



Joined: 01 Jul 2009
Posts: 10

Posted: Thu Sep 15, 2011 3:47 pm    Post subject: Step-by-step iptables configuration guide?  

I swear there used to be a step-by-step guide for configuring iptables in the Linode Library. It took you through creating the configuration files, and getting iptables to start up at each boot. Now all I can find is a document that tells you a lot about iptables commands but not how to set everything up for a basic firewall and have it enabled after every boot.

Also, what do we need to do to secure IPv6?

Thanks,

CT
Back to top  
voidfaction



Joined: 21 Mar 2011
Posts: 8
Location: Noblesville, IN

Posted: Fri Sep 16, 2011 2:14 am    Post subject:  

There is a very minimal iptables how to in the linode library.

ip6tables for ipv6.
Back to top  
Piki



Joined: 16 Jun 2011
Posts: 276
Location: Cyberspace

Posted: Fri Sep 16, 2011 1:50 pm    Post subject:  

Once you set the iptables rules using the commands in the Linode Library, log in as root and run the following command (or use sudo):
Code: root@li283-45:~# iptables-save > /root/default.fw
You can change default.fw to whatever you want to call the file. It doesn't need to be in /root either, just put it in a place where nobody can access it.

Some distributions will have the file called "/etc/rc.local", if you have it, you can add the command "iptables-restore /root/default.fw" (remove the quotes), replacing /root/default.fw with the firewall file. It will execute anything in /etc/rc.local at boot. You should also be able to do an init script, though I'm not experienced with writing init scripts, so I'm not going to attempt a sample script in case it messes up for you.

(edited to remove stray code tag)
Back to top  
 
       Linode Forum Index -> Linux Networking
Page 1 of 1