Enter your email address:

Delivered by FeedBurner

Firewall with linux


StumbleUpon Toolbar

Security is always an Issue in all computer environment and Linux is not an exception, you can use this to protect either your home PC or your small office network

This uses the script rc.firewall

Follow the instructions below.

* Getting the code

The first thing you need is to get the code, you can download it from here and get the final version, or the final stable.

 

  • Next configure is to your needs

 

Here are some tips.

Under Permit you write the network you want to allow access to your server/network

Permit "192.168.0.0/24 200.90.85.32/32 0.0.0.0:80/tcp 166.114.10.10/32:22/tcp"

On the above example you could see this.

  • Allow access to IPs from 192.168.0.1 to 192.168.0.254
  • Allow access to the specific IP 200.90.85.32
  • Allow access to tcp port 80 (WEB) to every body
  • Allow ssh access from 166.114.10.10

 

 

If you want to set up a firewall for your network and using NAT you should use the INTERNAL_INTERFACES parameter and put there your internal interface name for instance eth1.

  • Test it

 

First make the script executable

#chmod 700 rc.firewall

Now if you are testing in a local machine just run it and test if you still have access from the other sites you wish to have access.

If you are testing on a remote server, as far as you are connected you can run it, and try to open another ssh session if you are able to enter, you can continue, if not, you are blocking yourself. If you want to be really sure you are not going to block yourself and lost connection to your remote server, put a cronjob, to execute in 15 minutes with the command.

iptables -F

That should clean all iptables rules, and will have access again.

  • Make it automatic

Here I will start with Debian / Ubuntu and maybe other debian based distros. 

- Copy the script to /etc/init.d/

- run the command

#update-rc.d rc.firewall defaults 19

- Done !

Now lets go with Fedora, CentOS and RedHat Linux

- Copy the script to /etc/rc.d/

- run the command

#echo '/etc/rc.d/rc.firewall >> /etc/rc.local 

- Done !

 

Trackback URL for this post:

http://www.go2linux.org/trackback/3
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

When trying to read the

When trying to read the config files
I find that this project lfw is no longer active.

http://lfw.sourceforge.net/ (nothing)
http://lfw.sf.net/ (nothing)
and finally
http://sourceforge.net/projects/lfw/
we see..
"As of 2007-05-01 08:45, this project is no longer under active development."

There is a mirror of the old

There is a mirror of the old project located here

info
http://ledow.blogspot.com/2007/07/mirror-of-projectfilescom.html

actual mirror
http://www.ledow.org.uk/linux

peace all.

Thank you a lot! Guillermo

Thank you a lot!

Guillermo Garron

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting