Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a mac server but my question has long left the realm of the GUI. My last hope is a unix forum.

I have a cisco router with two WAN ports. The mac uses postfix 2.8.3. I have correctly configured the port forwarding for in this case port 25. When I however try to open a telnet session from an external host to the IP addresses of my WAN ports using port 25, I only get a postfix reply on WAN1. WAN2 gives me an "Unable to connect to remote host: Connection time out". If I however have WireShark running I can see that the router forwards the request, but postfix just doesn't seem to "pick up".

I reviewed my main.cf and there was nothing that suggested that postfix should be picky which WAN it wants to use. inet_protocols is set to all and I even tried adding the static ip addresses of each of my WAN ports to the my networks variable.

I can't seem to get it to work though - does anyone have any tips where I can look next?


share|improve this question
to clarify, the mac has 1 IP, and the router has 2 IPs. port forwarding is set up for both of the router's IP addresses to forward tcp/25 to the mac? Does your router use a routing protocol like BGP to hold a routing table, or does your router have a static default gateway? Does the mac itself actually see the traffic coming in to port 25? Could the problem be asynchronous routing, where the return packets are traveling back out of the router on WAN1, instead of WAN2, thus leaving the SMTP client to thing the connection cannot be made? – Tim Kennedy Sep 28 '11 at 14:15
mac 1IP, router 2IP yes | I think the router doesn't have a routing protocol (didn't see anything like that) | With wireshark (a program that shows which ports are active) I can see that the connection reaches the router | It could be a problem with asynchronous routing - I will look into that. – Joseph Sep 28 '11 at 14:28
Well the router is a Cisco RV042 but I can't seem to find any settings indicating that it asyncrhonous routing is on or off. – Joseph Sep 29 '11 at 13:03

Here's a couple things to check:

  • On the mac, run "tcpdump port 25". This will print to stdout everything coming into or out of port 25. Now telnet to both of the IPs on port 25. Does tcpdump print anything out for both IPs, or only for the first?
  • On the mac, run "postconf inet_interfaces". If you see "inet_interfaces = all", postfix should be listening on all interfaces.
  • On the mac, run "netstat -tapn|grep 25". This should return the interfaces that postfix is listening on. If you see something like "", postfix is listening on all interfaces.

If the second two tests are as I said, then the problem is at the router level. Also note that I performed my tests on a GNU/Linux host, so your results may differ slightly.

share|improve this answer
Test 1: tcpdump prints out stuff in both cases. Test 2: inet_interfaces is set to all. Test 3: when I run it that way I get an "netstat: n: unknown or instrumented protocol" if I do netstat by itself without the optional parameters I se something like "tcp4 0 0 m.mydomain.com.afpovertc ESTABLISHED" and "tcp4 0 0 localhost.10025 . LISTEN" – Joseph Oct 6 '11 at 11:48
just to clarify m.mydomain.com is a fully qualified subdomain (A-Record) pointing to my static ip. – Joseph Oct 6 '11 at 14:40

Your router does support load balancing using two WAN links. As I see the scenario now is you haven't configured any loadbalancing on the router, you have those two WAN links connected and the SMTP port forwarded to one of the LAN IPs (your mac), and the router only has one default gateway towards the internet i.e, WAN1. So even if the packet comes in via WAN2, it goes out via WAN1 towards the client, and the client would see it like saying Hi to A and getting a reply from B, which it would for obvious reasons ignore and thusly a timeout. IMHO enabling loadbalancing alone should help solve your problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.