Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables: destination nat onto same network

Reply
Thread Tools Display Modes

iptables: destination nat onto same network

 
 
Chris Lutka
Guest
Posts: n/a

 
      03-16-2005, 09:01 PM
I have successfully implemented the classic scenario where internal
users are trying to access a public web server which has been DNAT'ed
to an internal machine (to paraphrase the NAT-HOWTO). Actually, I've
done that for my SMTP and POP servers as well. The problem is that my
firewall which does the DNAT'ing cannot send mail to the public IP
address. I have been scratching my head looking at the nat OUTPUT
chain and the POSTROUTING chain but I can't seem to figure it out. I
would appreciate it if someone could point me in the right direction.

-Chris
 
Reply With Quote
 
 
 
 
Moe Trin
Guest
Posts: n/a

 
      03-18-2005, 12:48 AM
In article <(E-Mail Removed) >, Chris Lutka
wrote:

>I have successfully implemented the classic scenario where internal
>users are trying to access a public web server which has been DNAT'ed
>to an internal machine (to paraphrase the NAT-HOWTO). Actually, I've
>done that for my SMTP and POP servers as well. The problem is that my
>firewall which does the DNAT'ing cannot send mail to the public IP
>address.


The normal solution I've seen for this is to have the local name resolution
(local name server, or /etc/hosts file) resolve the external name to the
internal address of the servers. Any _external_ resolution of the names
still points through the NAT, so external hosts can find things.

Old guy

 
Reply With Quote
 
Chris Lutka
Guest
Posts: n/a

 
      03-18-2005, 03:09 PM
> >done that for my SMTP and POP servers as well. The problem is that my
> >firewall which does the DNAT'ing cannot send mail to the public IP
> >address.

>
> The normal solution I've seen for this is to have the local name resolution
> (local name server, or /etc/hosts file) resolve the external name to the
> internal address of the servers. Any _external_ resolution of the names
> still points through the NAT, so external hosts can find things.


Thanks for the reply.

I had tried this. Sendmail does an MX record lookup to my internal
DNS server which has the external IP address record. I want to keep
it this way since I have laptop users who have had issues in the past
trying to connect from an external provider to get their email and the
cached DNS still pointed to our internal IP. I didn't/don't want to
change the cache time for the entry since I'm already bogging down
that server.

One of the only ways I can figure things out is to edit my internal
DNS to include another domain and set the MX record to be the internal
IP address of the mail server and have it accept mail from the
non-existent domain. I would really like to have the mail served
properly and configure the iptables information correctly for the
firewall.

-Chris
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      03-19-2005, 01:35 AM
In article <(E-Mail Removed) >, Chris Lutka
wrote:

>I had tried this. Sendmail does an MX record lookup to my internal
>DNS server which has the external IP address record. I want to keep
>it this way since I have laptop users who have had issues in the past
>trying to connect from an external provider to get their email and the
>cached DNS still pointed to our internal IP.


I think you may want to google the comp.mail.sendmail newsgroup. The
Sendmail-FAQ mentions this problem, but their solutions aren't neat.
Still, I'm not sure I'm following you. When your users are external,
they should be looking up the addresses with their ISPs name server,
not your internal name server. Thus, the mail server should resolve to
an external IP. When they are inside, they should not be using the
external name server, but should be pointed at the internal server
which would then give the mail server address as the local one. Not
that many user systems cache the name server data anyway.

>One of the only ways I can figure things out is to edit my internal
>DNS to include another domain and set the MX record to be the internal
>IP address of the mail server and have it accept mail from the
>non-existent domain. I would really like to have the mail served
>properly and configure the iptables information correctly for the
>firewall.


Old guy
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables REDIRECT original destination-ip bubzilla Linux Networking 4 10-18-2006 10:45 AM
(iptables) connlimit per destination IP equivalent dzikus Linux Networking 1 04-07-2006 11:23 PM
Destination Net unrechable problem in Network. =?Utf-8?B?UkFKVSBU?= Broadband Hardware 1 09-19-2005 06:34 AM
Destination Unreachanble: Fedora Core 2 : Network Does not work. john.maximus@gmail.com Linux Networking 12 05-10-2005 09:16 PM
IPTABLES: -d (destination)=Internet AcCeSsDeNiEd Linux Networking 2 10-02-2004 11:36 AM



1 2 3 4 5 6 7 8 9 10 11