Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: Help with alias interfaces
Date: Wed, 23 Jun 2004 15:53:01 +0100	[thread overview]
Message-ID: <200406231553.01584.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <FLECICIIDHIEIENHHOOLIEFNCCAA.esanz@minorplanetusa.com>

On Wednesday 23 June 2004 4:31 pm, Erick Sanz wrote:

> All,
>
> 	I tried the suggested solution with no luck...  Also,
> I did not hear from anybody hosting DNS...

Multiple IPs on a single interface are nothing special for netfilter.

The deprecated way to get multiple IPs results in pseudo-interface names such 
as eth1:0, eth1:1 etc as you discussed.   The recommended way to assign 
multiple IPs on one interface (ip addr add a.b.c.d dev eth1) simply results 
in multiple IPs on the interface - no strange new names appear, therefore I 
think it is a much more obvious and clear way of doing it.

Either way, once you are configuring your netfilter rules, you simply refer to 
the simple interface name (eg eth1).   It makes no difference to netfilter 
which method you used to get the multiple addresses assigned.

Also, I see nothing wrong with your DNS rules - there's nothing special about 
getting packets to a DNS server NATted and FORWARDed (so long as you remember 
it uses both UDP and TCP, which you have).   Other than that, it's just the 
same as doing this for a web server, mail server, etc.

Do you have other such servers which *are* working properly with NAT and 
FORWARDing?   If so, is there any obvious difference about the rules, the 
routing, or the machines which can / cannot access the appropriate servers?

Regards,

Antony.

> 	Original post below.
>
> Best regards,
> Erick Sanz
>
> > 	All,
> >
> > 	I have multiple interfaces in a system (eth1, eth1:0,
> > eth1:1 and eth1:2),
> > and I need to forward things for several ports to them.
> >
> > 	Since IPtables do not understand eth1:1, my rules look
> > something like
> > this:
> >
> > # Ftp server
> >     iptables -t nat -A PREROUTING -p tcp -d $FTP_IPADDR --dport
> > 21 -j DNAT --to $FTP_SERVER
> >     iptables -A FORWARD -i eth1 -p tcp -d $FTP_SERVER --dport 21
> > -m state --state NEW -j ACCEPT
> >
> > # Web server
> >     iptables -t nat -A PREROUTING -p tcp -d $WEB_IPADDR --dport
> > 80 -j DNAT --to $WEB_SERVER
> >     iptables -A FORWARD -i eth1 -p tcp -d $WEB_SERVER --dport 80
> > -m state --state NEW -j ACCEPT
> >
> > 	eth1 is my WAN interface... Is this correct?
> >
> > 	Also, for the life of my I don't seem to be able to get DNS
> > resulution to my
> > DNS server; my rules are as follows:
> >
> >     iptables -t nat -A PREROUTING -p udp -d $DNS_1 --dport 53 -j
> > DNAT --to $DNS_SERVER1
> >     iptables -t nat -A PREROUTING -p tcp -d $DNS_1 --dport 53 -j
> > DNAT --to $DNS_SERVER1
> >
> >     iptables -t nat -A PREROUTING -p udp -d $DNS_2 --dport 53 -j
> > DNAT --to $DNS_SERVER2
> >     iptables -t nat -A PREROUTING -p tcp -d $DNS_2 --dport 53 -j
> > DNAT --to $DNS_SERVER2
> >
> >     iptables -A FORWARD -i eth1 -p udp -d $DNS_SERVER1 --dport 53
> > -m state --state NEW -j ACCEPT
> >     iptables -A FORWARD -i eth1 -p tcp -d $DNS_SERVER1 --dport 53
> > -m state --state NEW -j ACCEPT
> >
> >     iptables -A FORWARD -i eth1 -p udp -d $DNS_SERVER2 --dport 53
> > -m state --state NEW -j ACCEPT
> >     iptables -A FORWARD -i eth1 -p tcp -d $DNS_SERVER2 --dport 53
> > -m state --state NEW -j ACCEPT
> >
> > 	Besides those rules, I also allow ping to those interfaces.
> >
> > 	Does anybody host their own DNS, if so, could you share
> > your rules (without
> > IP addresses, to protect the identity of the inocent...)    ;)
> >
> > 	Beforehand, thank you for your help!
> >
> > Best regards,
> > Erick Sanz
>
> This email message has been scanned for viruses.

-- 
"There is no reason for any individual to have a computer in their home."

 - Ken Olsen, President of Digital Equipment Corporation (DEC, later consumed 
by Compaq, later merged with HP)

                                                     Please reply to the list;
                                                           please don't CC me.



  reply	other threads:[~2004-06-23 14:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-21  9:14 DNAT problem / question (nfcan: addressed to exclusive sender for this address) Arnauts, Bert
2004-06-21 16:45 ` Help with alias interfaces Erick Sanz
2004-06-21 17:11   ` Paweł Staszewski
2004-06-21 18:22     ` mlody
2004-06-21 18:44       ` Paweł Staszewski
2004-06-21 19:15         ` mlody
2004-06-23 15:31   ` Erick Sanz
2004-06-23 14:53     ` Antony Stone [this message]
2004-06-23 19:01       ` Dick St.Peters
2004-06-23 19:22         ` Antony Stone
2004-06-23 20:30           ` Dick St.Peters
2004-06-23 20:47             ` Antony Stone

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=200406231553.01584.Antony@Soft-Solutions.co.uk \
    --to=antony@soft-solutions.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox