Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Debian 6 - iptables
PostPosted: Fri Jun 17, 2011 12:04 pm 
Offline
Senior Newbie

Joined: Thu Jun 16, 2011 10:44 am
Posts: 6
I’m totally new to Linux, decided to try and learn it so I got a Linode 512 with Linux Debian 6 to learn on.

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

Code:
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

Code:
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


Top
   
 Post subject:
PostPosted: Fri Jun 17, 2011 12:09 pm 
Offline
Senior Newbie

Joined: Sun Aug 22, 2010 12:57 pm
Posts: 19
I recommend the package "ufw" for doing firewall crap. Manual IPTables makes my brain hurt.


Top
   
 Post subject:
PostPosted: Fri Jun 17, 2011 1:10 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
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.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Jun 17, 2011 4:08 pm 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
obs wrote:
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 here. Not really resolved, the OP went with shorewall. +1 for shorewall, I use it everywhere I can't use pf.

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Fri Jun 17, 2011 4:38 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
I recommend just learning basic IPTABLES.

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.


Top
   
 Post subject:
PostPosted: Sat Jul 16, 2011 6:00 pm 
Offline
Senior Newbie

Joined: Thu Jun 16, 2011 10:44 am
Posts: 6
Sorry it took so long to get back to you all for the responses you gave, was on a short vacation.

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


Top
   
 Post subject:
PostPosted: Sun Jul 17, 2011 11:55 am 
Offline
Senior Member

Joined: Sun May 23, 2010 1:57 pm
Posts: 315
Website: http://www.jebblue.net
obs wrote:
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.


Top
   
 Post subject: to answer the question
PostPosted: Sun Aug 14, 2011 3:58 pm 
Offline
Senior Newbie

Joined: Sun Aug 14, 2011 2:13 pm
Posts: 6
you can either add the script to /etc/rc.local, or you can see

Code:
man update-rc.d 


for how to completely customize you boot scripts.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: sjnorton and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group