Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Mark Arrasmith <arrasmith@math.twsu.edu>
To: axp-list@redhat.com
Subject: Re: firewall for linux
Date: Mon, 11 Mar 2002 06:23:49 -0600	[thread overview]
Message-ID: <20020311122927.ZENM8816.mtiwmhc23.worldnet.att.net@there> (raw)
In-Reply-To: <000901c1c8da$e8134fd0$559f82c2@ted>

On Monday 11 March 2002 02:57 am, you wrote:
> Hello,
> What s the best firewall for linux 6.2.
> Any recommendations ?? and if possible send me
> the HOW-TO for implementation.

Create the file /etc/sysconfig/ipchains either with your own script or using 
something like lokkit ( http://www.linux.org.uk/apps/lokkit.shtml )

Here is an example that allows access to ssh (port 22) from anywhere, 
loopbacks, and dns lookups, but blocks pretty much everything else.  Replace 
dns addresses with the IP's of the DNS machines you use.

:input ACCEPT
:forward ACCEPT
:output ACCEPT
#this allows ssh, port 22, to get through
-A input -s 0/0 -d 0/0 22 -p tcp -y -j ACCEPT
#this allow lo access
-A input -s 0/0 -d 0/0 -i lo -j ACCEPT
#the next two are for DNS access.  Replace the fake IP's with yours.
-A input -s 192.168.1.1 53 -d 0/0 -p udp -j ACCEPT
-A input -s 192.168.1.2 53 -d 0/0 -p udp -j ACCEPT
#the next two reject everything else.
-A input -s 0/0 -d 0/0 -p tcp -y -j REJECT
-A input -s 0/0 -d 0/0 -p udp -j REJECT

Once you have a setup you like, just run . . .
    /etc/rc.d/init.d/ipchains restart
and add links to the proper runtime rcx.d directories.  You can see the 
ipchains running configuration by running . . .
   cat /proc/net/ip_fwchains

other examples:
#allow ssh only from 192.168. networks . . .
-A input -s 192.168.0.0/255.255.0.0 -d 0/0 22 -p tcp -y -j ACCEPT

#allow http access from anywhere
-A input -s 0/0 -d 0/0 80 -p tcp -y -j ACCEPT

#allow all ethernet traffic on eth0 from the 192.168.12. network . . . 
-A input -s 192.168.12.0/255.255.255.0 -d 0/0 -i eth0 -j ACCEPT

Hope this helps.  Make sure you have physical access to the machine in case 
your rules don't allow you to access the machine remotely.

- mark arrasmith




      reply	other threads:[~2002-03-11 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-11  8:57 firewall for linux Ted Lufoma
2002-03-11 12:23 ` Mark Arrasmith [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox