Debian 6 - iptables
Learning about iptables I found the below on Google:
First make iptables rules and made sure they work.
Second is to save those rules to a configuration file
iptables-save > /root/scripts/iptables.save
Save custom scripts and required files in the /root/scripts/ folder.
Google showed me how to make the scripts folder.
Third make a script that loads the iptables rules at reboot
echo "#!/bin/bash" > /etc/network/if-up.d/iptables
echo "iptables-restore < /root/scripts/iptables.save > >> /etc/network/if-up.d/iptables
chmod +x /etc/network/if-up.d/iptables
Now I have done one and two but don’t know how to do step three.
I got a program called programmers note pad but what do I save the file as, and is “/etc/network” the correct path/location for Linode?
Thanks
Sarah
7 Replies
@obs:
some ufw versions do some funky things with linode kernels (there was a post about this a few weeks ago, can't remember if it was resolved), I prefer shorewall.
It was. Not really resolved, the OP went with shorewall. +1 for shorewall, I use it everywhere I can't use pf. here
It's not that hard (for the basic stuff) and you have the advantage of knowing exactly what's being done. Front ends are nice, until they bork something up and you have to dig into the raw IPTABLES to fix it. Might as well avoid the middle step.
I learned how to do the iptables from the command line and learned what nano is and where to save the file.
I do have a cron question but will start a new topic for that if I cant sort it latter today.
Thanks
@obs:
some ufw versions do some funky things with linode kernels (there was a post about this a few weeks ago, can't remember if it was resolved), I prefer shorewall.
ufw works for me but I use Ubuntu not Debian.
Of course learning iptables is a great idea, you can do much more with it when you need to.
man update-rc.d
for how to completely customize you boot scripts.