Author Topic: To bulld a small software firewall in LINUX .......  (Read 2566 times)

Eric

  • Global Moderator
  • Newbie
  • *****
  • Posts: 13
To bulld a small software firewall in LINUX .......
« on: June 06, 2007, 04:33:46 PM »
LINUX

Security with LINUX ..

Firewalls are used to ensure that unauthorized access to enterprise through its externally facing access points are prevented. Firewalls technology is more than 10 years old.  Using different methods and different technologies, we can configure firewalls to protect the  networks and the servers from unauthorized access. Mainly there are two firewalls types.  Those are Hardware firewall and Software firewalls.

 To build a firewall(software)in LINUX we have to use IPTables ....  . :o
But Guys you do not worry...  ;) it is very easy to than configuring Hardware firewall ...

We will start from basic IPtable commands...

Basic IPTables commands.

To check existing IPTables in your server

iptables -L [chain] - Lists your current iptables configuration

To Making modification.


iptables -A [chain] - Append a rule to a desired chain in the current configuration

iptables -D [chain] - Delete a rule from a desired chain in the current configuration

iptables -R [chain] - Replace an existing rule from a desired chain in the current configuration



iptables - I [chain] - (that's a capital I as in Insert) Insert a new rule into a desired chain of the current configuration

iptables -N [chain] - Create a new chain

iptables -X [chain] - Delete a chain

iptables -F - Flush the table of all contents

iptables -p - Match protocol. Types include, icmp, tcp,udp, all

iptables –s - Match source IP address

iptables –d - Match destination IP address

iptables – i - Match "input" interface on which the packet enters.

Iptables- o - Match "output"packet exits


 :DOk.  Guys now pls refer this example using above mention commands.

iptables -A INPUT -s 0/0 -i eth0 -d 192.168.128.2 -p TCP -j ACCEPT

This command says ……………  ::)

  :DIn this example, iptables is being configured to allow the firewall to accept TCP packets coming in on
interface eth0 from any IP address destined for the firewall's IP address of 192.168.128.2  The "0/0"
representation of an IP address means "any".


« Last Edit: June 25, 2007, 04:07:48 PM by Open Your Hands »

Romio

  • Global Moderator
  • Full Member
  • *****
  • Posts: 226
Re: To bulld a small software firewall in LINUX .......
« Reply #1 on: June 07, 2007, 06:54:02 AM »
Thnkx Bro.  :) :) Will try to do this   ::)
W w W . o P e n g U y s . o R g

Mark

  • Newbie
  • *
  • Posts: 1
    • Email
Re: To bulld a small software firewall in LINUX .......
« Reply #2 on: June 07, 2007, 02:12:29 PM »
Eric...... Thanks for your IPTables lesson .. ;) Likewise i have one problem ... That is  I want to stop incoming ping request to my mcahine...  My machine 's OS is   Fedora 5  .. Pls advice ASAP  :-[
« Last Edit: June 07, 2007, 02:14:23 PM by Mark »

Eric

  • Global Moderator
  • Newbie
  • *****
  • Posts: 13
Re: To bulld a small software firewall in LINUX .......
« Reply #3 on: June 14, 2007, 12:00:56 PM »
Ok .. Mark . . That is a  simple thing and try this command and let us now ...


The command is .....  iptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT                 ;)

GoogleTagged