All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Brian Ugie" <bugie@pzs.com>
To: ramin@cannon.eng.us.uu.net, nickd@funkyjesus.org,
	netfilter@lists.samba.org
Subject: Re: iptables and DNS
Date: Tue, 04 Jun 2002 11:35:39 -0700	[thread overview]
Message-ID: <scfca615.002@pzsj-office.pzs.com> (raw)

Actually iptables-save will resolve to ip when it saves regardless of
weather you created the chain with IPs or hostnames. I guess you would
never know which way I did it but I assure you that I am entering the
IPs when I create the chains.

  I feel that you are all missing what the problem is. Let me see if I
can explain it better.

The example server is NS2.pzs.com and has an ip address of 10.1.1.13

The DNS record for NS2.pzs.com is 66.126.189.37

A firewall appliance sits in front of the server and mapps the public
address to the private address. The firewall will only allow port 53
/udp/tcp traffic in. 

Now, this works fine with no iptable rules but once I add, say

iptables -A INPUT -d 10.1.1.13 -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -d 10.1.1.13 -p udp --dport 53 -j ACCEPT
iptables -P INPUT  DROP

DNS will nolonger respond on NS2. But if I go into NS1 and change the
NS2 record so that is resolves to 10.1.1.13, the above rules will work.

--Brian

>>> Ramin Alidousti <ramin@cannon.eng.us.uu.net> 06/04/02 11:09AM >>>
On Tue, Jun 04, 2002 at 06:52:23PM +0100, Nick Drage wrote:

> On Tue, Jun 04, 2002 at 10:41:58AM -0700, Brian Ugie wrote:
> > Below  is the hosts portion of nsswitch.conf.  The actual hosts
file is
> > below that. I have also included the simple config that I am using
for
> > iptables. I have seen the -n option but it is not relevant for
appending,
> > inserting or replacing. It only applies to listing (output)
> 
> Er, unless I'm missing something, you're using hostnames in your
IPTables
> rules, and then complaining that IPTables is resolving those
hostnames?

Good catch, Nick. I thought brain wanted to "-L" the iptables command
to check out the rules. In order to set the rules, follow the below
guidline.

Ramin

> 
> Excuse me if this sounds obvious, but why not use IP addresses in the
rule
> specifications.  If you're worried about having to alter all the
relevant
> rules if an IP address changes then just assign it to a variable...
> 
> #!/bin/sh -x
> 
> WEBSERVER="10.10.10.13"
> 
> iptables -A INPUT -p tcp -d $WEBSERVER --dport 80 -j ACCEPT
> iptables -A INPUT -p tcp -d $WEBSERVER -j REJECT --reject-with
tcp-reset
> 
> etc. 
> 
> <snip>
> 
> -- 
> FunkyJesus System Administration Team
> 



             reply	other threads:[~2002-06-04 18:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-04 18:35 Brian Ugie [this message]
     [not found] <scfca615.000@pzsj-office.pzs.com>
2002-06-04 18:48 ` iptables and DNS Ramin Alidousti
2002-06-04 19:34   ` Antony Stone
  -- strict thread matches above, loose matches on Subject: below --
2002-06-04 17:41 Brian Ugie
2002-06-04 17:52 ` Nick Drage
2002-06-04 18:09   ` Ramin Alidousti
2002-06-04 16:51 Brian Ugie
2002-06-04 17:28 ` Ramin Alidousti

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=scfca615.002@pzsj-office.pzs.com \
    --to=bugie@pzs.com \
    --cc=netfilter@lists.samba.org \
    --cc=nickd@funkyjesus.org \
    --cc=ramin@cannon.eng.us.uu.net \
    /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.