All of lore.kernel.org
 help / color / mirror / Atom feed
From: "JUSTIN GERRY" <JGERRY@butchers.com>
To: netfilter@lists.netfilter.org
Subject: Trying to setup two ethernet cards with two websites
Date: Tue, 31 Dec 2002 11:29:13 -0500	[thread overview]
Message-ID: <se117fa8.025@butchers.com> (raw)

I am attempting to setup two websites with two ip address, each one on a
different ethernet card/interface.

It only seems to work for the first rule (first listed ip address) that
gets matched up, so I can get one website to work but not the other. How
do I write this so it covers both address and allows httpd to go to
either interface or either address? Can I write a single rule to match a
range of ip addresses (.93 and .94) instead of writing one for each
individual address? 

This is what I have so far for testing.....

IF1="eth0"
IF2="eth1"
IP2="172.30.12.93"
IP1="172.30.12.94"
UNPRIVPORTS="1024:65535"

iptables -F
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT 
iptables -A INPUT -i $IF1 -p tcp --sport $UNPRIVPORTS -d $IP1 --dport
80 -m state --state NEW -j ACCEPT
iptables -A INPUT -i $IF2 -p tcp --sport $UNPRIVPORTS -d $IP2 --dport
80 -m state --state NEW -j ACCEPT
iptables -A INPUT -i $IF1 -p tcp --sport $UNPRIVPORTS -d $IP1 --dport
80 -j ACCEPT
iptables -A INPUT -i $IF2 -p tcp --sport $UNPRIVPORTS -d $IP2 --dport
80 -j ACCEPT
iptables -A OUTPUT -o $IF2 -p tcp ! --syn -s $IP2 --sport 80 --dport
$UNPRIVPORTS -j ACCEPT
iptables -A OUTPUT -o $IF1 -p tcp ! --syn -s $IP1 --sport 80 --dport
$UNPRIVPORTS -j ACCEPT

Thanks,
Justin


             reply	other threads:[~2002-12-31 16:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-31 16:29 JUSTIN GERRY [this message]
2002-12-31 18:49 ` Trying to setup two ethernet cards with two websites Roy Sigurd Karlsbakk
  -- strict thread matches above, loose matches on Subject: below --
2003-01-02 14:49 JUSTIN GERRY
2003-01-02 15:21 ` Joel Newkirk
2003-01-03 12:23   ` Roy Sigurd Karlsbakk
2003-01-03 16:25     ` Joel Newkirk
2003-01-02 20:25 JUSTIN GERRY
2003-01-02 20:36 ` Athanasius
2003-01-02 21:40 ` Rob Sterenborg
2003-01-03 12:23 ` Roy Sigurd Karlsbakk

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=se117fa8.025@butchers.com \
    --to=jgerry@butchers.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.