All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Russo <ben@umialumni.com>
To: Joel Linuxdude <linuxlists@hotmail.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: To REDIRECT, DNAT or something else
Date: 26 Nov 2002 09:31:45 -0500	[thread overview]
Message-ID: <1038321105.13699.19.camel@ben.mis.tnsi.com> (raw)
In-Reply-To: <F168SlVviFluZw0VclX000110a1@hotmail.com>

On Mon, 2002-11-25 at 18:43, Joel Linuxdude wrote:
> I just had a small question (maybe dumb, I dont care).
> 
> My firewall PC is also my DNS server (caching), gateway to
> the internet via cable modem, web server, ftp server and
> later my proxy server.
> 
> Do I need to REDIRECT packets coming into eth0 (from the
> cable modem) to the firewall itself?? I know, the packets
> are suppose to go right to INPUT chain but people over
> the internet can no longer access my WWW, FTP or TELNET
> daemon. I fear A) The cable modem company are blocking
> the use of servers or B) I screwed up somewhere in my
> firewall script.
> 
> HOW CAN I MAKE SURE ALL TCP/UDP PORT 20,21,22,23,80,443
> GO FROM CABLE MODEM ON ETH0 TO MY FIREWALL AND NOT GET
> FORWARDED OVER ETH1 TO MY LAN?

Assuming you have only 2 interfaces on your firewall
and the internal interface has only one subnet.

In the POSTROUTING rules set your MASQUERADE rule
for source $INTERNAL_SUBNET where -o $EXTERNAL_INTERFACE

Set your FORWARD policy to DROP
Allow only ESTABLISHED,RELATED in your FORWARD rule set
for -d $INTERNAL_SUBNET
Allow NEW,RELATED,ESTABLISHED in your FORWARD rule set
where source is $INTERNAL_SUBNET and -i $INTERNAL_INTERFACE

Set your INPUT policy to DROP
Allow INPUT of RELATED,ESTABLISHED
In the INPUT rules allow NEW to come
into tcp ports 20,21,22,23,80,443 for -i eth0

Allow -i eth0 -udp --sport 67:68 --dport 67:68
in INPUT for the DHCP traffic from your cable


and you also might want *some* ICMP
-A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 4 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 5 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A INPUT -i eth0 -p icmp -j DROP




  reply	other threads:[~2002-11-26 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-25 23:43 To REDIRECT, DNAT or something else Joel Linuxdude
2002-11-26 14:31 ` Ben Russo [this message]
2002-11-26 14:40 ` cbaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1038321105.13699.19.camel@ben.mis.tnsi.com \
    --to=ben@umialumni.com \
    --cc=linuxlists@hotmail.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.