Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-23-2013, 09:58 AM
|
#1
|
Member
Registered: Apr 2010
Location: India /Hyderabad
Distribution: RedHat, CentOS
Posts: 273
Rep:
|
smtp natting with iptables
Hi all,
I have mail server running behind CentOS firewall. So if user wants to connect mail server he has to go through the firewall. I configured iptalbes as below
Quote:
iptables -t nat -A PREROUTING -s 0/0 -p tcp --dport 25 -j DNAT --to-destination 192.168.x.x:25
|
seems ok but some times not,
Quote:
if i telnet from outside it takes around half a min to connect. but if telnet from CentOS it connects quickly like normal.
|
is my rule ok or i need anything else, please help me.
thanks in advance.
|
|
|
07-23-2013, 11:40 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
long delays are typically DNS lookup based. I'd guess that your server is taking your source IP and trying to get a name for it.
if you're using postfix, see here - http://www.postfix.org/postconf.5.ht...eername_lookup although it doesn't look like there's really anything to fix.
|
|
|
07-23-2013, 02:08 PM
|
#3
|
Member
Registered: Apr 2010
Location: India /Hyderabad
Distribution: RedHat, CentOS
Posts: 273
Original Poster
Rep:
|
Hi,
thanks for reply, i'm using ms exchange 2003. Please help me, how to over come this dns lookup issue.
And what about iptables, is it correct do i need any forward rule, please tell me.
thank you very much.
Last edited by Gil@LQ; 07-23-2013 at 02:10 PM.
|
|
|
07-24-2013, 02:14 AM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
well that's a windows problem then. Personally I've no idea about M$ specifics, but I'm sure google could help you out in seconds. I'd presume offhand it's just a case of having a functional DNS service for Exchange to query. Some traffic dumps from wireshark on the server would be useful to see if there are unanswered DNS queries being made. I've also no proof that that IS the problem, just a hunch.
|
|
|
07-24-2013, 08:07 AM
|
#5
|
LQ Newbie
Registered: Sep 2011
Posts: 9
Rep: 
|
Hi,
If your telnet is trying to do a lookup there should be an option to prevent it from doing so, for eg. on mac you can do a telnet with the -N flag to prevent a lookup and see if that is what's causing the time delay.
|
|
|
07-24-2013, 08:31 AM
|
#6
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
Quote:
Originally Posted by paddy2de
Hi,
If your telnet is trying to do a lookup there should be an option to prevent it from doing so, for eg. on mac you can do a telnet with the -N flag to prevent a lookup and see if that is what's causing the time delay.
|
the -N flag would be for a telnet **server**. He doesn't have a telnet server, he has an MS Exchange server.
|
|
|
07-24-2013, 08:40 AM
|
#7
|
Member
Registered: Apr 2010
Location: India /Hyderabad
Distribution: RedHat, CentOS
Posts: 273
Original Poster
Rep:
|
Hi all,
As acid_cupid said, it could be dnslookup error, what i did was i port forwarded in iptalbes, i did like
Quote:
source port to 1535 and destination port to 25
|
now telnet is normal and quick, i guess 25 is universally for smtp which is why trying dnslookup.
my doubt is telnet is ok from CentOS firewall, but why users unable to do quickly through the same CentOS firewall ? any idea, so that i could try sorting out.
Thank you very much.
|
|
|
07-24-2013, 08:45 AM
|
#8
|
LQ Newbie
Registered: Sep 2011
Posts: 9
Rep: 
|
Quote:
Originally Posted by acid_kewpie
the -N flag would be for a telnet **server**. He doesn't have a telnet server, he has an MS Exchange server.
|
Perhaps I misunderstood, I gathered from the OP that he was trying to telnet through the firewall to the Exchange server, telneting throught it causes a delay, telneting from the firewall (bypassing IP tables does not).
What I meant was that if the delay is being caused by DNS lookup delays then he should be able to prevent his telnet client from attempting a lookup. I just tested this:
xxx@mac1:~$ telnet 172.19.xx.xx 22
Trying 172.19.99.10...
Connected to <hostname>.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.2
telnet> quit
Connection closed.
xxx@mac1:~$ telnet -N 172.19.xx.xx 22
Trying 172.19.xx.xx...
Connected to 172.19.xx.xx.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.2
Connection closed by foreign host.
Now see if the delay is apparent on both tests.
If I've completely missed the point I apologise, our coffee machine is broken...
Last edited by paddy2de; 07-24-2013 at 08:46 AM.
|
|
|
07-24-2013, 08:53 AM
|
#9
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Quote:
Originally Posted by Gil@LQ
Hi all,
I have mail server running behind CentOS firewall. So if user wants to connect mail server he has to go through the firewall. I configured iptalbes as below
seems ok but some times not,
is my rule ok or i need anything else, please help me.
thanks in advance.
|
What command are you using on the firewall box, and what command are you using from outside? Are they both linux machines? What does the routing table look like? different dns servers? are you using the firewall for anything else, and does it work correctly?
|
|
|
All times are GMT -5. The time now is 07:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|