LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-28-2007, 01:40 PM   #1
Histamine
LQ Newbie
 
Registered: Jun 2007
Posts: 20

Rep: Reputation: 0
Iptables help w/ internal interface


I'm looking to set up IMAP for people to use outside of work and inside of work. The problem is that I don't want to have them to have to keep changing the server to connect to. Externally they would have to connect to "www.server.com:4566", and internally "server:4566". I have and external adapter "eth0" and an internal adapter "eth1", plus a server running the imap server. I can make the connect from eth0 to the imap server, how do I make the connection bounce from eth1 to the imap server?

I've tried:

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 4566 -j DNAT --to-destination 192.168.0.249:4566

iptables -t filter -A FORWARD -i eth1 -o eth1 -p tcp -m state --dport 4566 --syn --state NEW,ESTABLISHED,RELATED -j ACCEPT

iptables -A FORWARD -i eth1 -d 192.168.0.249 --dport 4566 -j ACCEPT

The last two not at the same time.

If some has a better idea about how to do it, I'd appreciate it.

TIA
 
Old 06-28-2007, 02:55 PM   #2
framp
Member
 
Registered: Apr 2003
Location: Next to Stuttgart, Germany
Distribution: Debian, Mint, Raspbian
Posts: 131
Blog Entries: 5

Rep: Reputation: 27
Do you have a local nameserver which is used per dhcp by your clients? Just add 'server' to point to the right IP.
 
Old 06-28-2007, 03:37 PM   #3
Histamine
LQ Newbie
 
Registered: Jun 2007
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks

But I don't think that will work. Both of the servers have static IP addresses and our web page is on the internet. It can already find www.server.com. Having 2 addresses point to the web page might confuse things.

I guess I'll have to put it another way. I want IMAP requests to come in eth1, then be forwarded back out eth1 to the IMAP server.
 
Old 06-28-2007, 05:14 PM   #4
framp
Member
 
Registered: Apr 2003
Location: Next to Stuttgart, Germany
Distribution: Debian, Mint, Raspbian
Posts: 131
Blog Entries: 5

Rep: Reputation: 27
Quote:
Originally Posted by Histamine
I guess I'll have to put it another way. I want IMAP requests to come in eth1, then be forwarded back out eth1 to the IMAP server.
I thought your problem is to connect to your server from either the internet or from an internal net transparently. Looks like I missed your problem.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables-- internal network HopelessLinuxNewbie Linux - Security 3 07-27-2005 08:49 PM
router with 2 externel interface and 1 internal?? fhameed Linux - Networking 1 12-09-2004 06:24 AM
ftp to internal box with iptables thesnaggle Linux - Networking 1 04-02-2004 10:15 AM
IPtables - cannot access internal webserver tantric Linux - Security 3 03-17-2004 02:20 AM
iptables blocking internal access? complus Linux - Networking 17 03-08-2004 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration