Koozali.org: home of the SME Server

Changing IP external address of e-smith server and keeping t

Mark Lenan

Changing IP external address of e-smith server and keeping the mail flowing…

Background :
I have an e-smith server that is connected to the world using an ISDN line and Router. Our ISP gives us a fixed IP address and allows 24x7 connection, the router does NAT and uses port forwarding pass the incoming packets to the e-smith box. The e-smith box acts as a mail server and Internet gateway for the local network.  This has worked successfully for several years, with our domain’s  MX record pointing to our e-smith box mail arrives promptly. As the loss of incoming email would be embarrassing I have a backup mail server hosted elsewhere with a lower priority MX record.

This is how it was configured:
Internet -> (fixed IP address )ISDN router(192.168.1.1) -> (192.168.1.2)e-smith(192.168.2.1)-> internal network.

ADSL recently became available in our area and we have had it installed from a different ISP who gave us a block of 8 fixed IP addresses (x.y.z.248 -> x.y.z.255). An ADSL router has been sourced and tested to work with a laptop.

So my problem was to move the e-smith server from the ISDN connection to the ADSL connection without loosing (or greatly delaying) email delivery. I came up with three solutions below. I tried solution 1 but it did not work so I used solution 2 instead.

Can any one tell me why 1 did not work? It might show some a major misunderstanding on my behalf but I believe you can’t learn without making mistakes!

Method 1) I wanted to keep mail arriving via the ISDN line but allow it to arrive from the ADSL line too, so that as the DNS changes to my MX records propagated mail would shift from ISDN to ADSL router but during the transition it could arrive on either. To try and achieve this I changed the ISDN routers internal IP address and the e-smith’s external address to be in the subnet of the ADSL router and connected both routers to the e-smiths external network using a switch. Eg:

Internet -> (fixed IP address)ISDN router(public x.y.z.253 subnet 255.255.255.248)->
&
Internet -> ADSL router(public x.y.z.254 subnet 255.255.255.248)->

->(public x.y.z.249 subnet 255.255.255.248)e-smith(192.168.2.1) -> internal network.

The ISDN router’s port forwarding was changed to forward to the e-smiths new IP address of x.y.z.249.

I set the e-smith’s gateway address to the IP of the ADSL router (x.y.z.254). From the e-smith box I could ping both routers. From and external site I could ping the e-smith box and the public IP of the ISDN router.

The problem was that email was not arriving via the ISDN line, switching the e-smith’s gateway address to that of the IDSN router allowed it to arrive but then not via the ADSL router. Using telnet from and external site to port 25 proved the point, I could only get a response via ISDN or ADSL if that router was set as the gateway address. I am puzzled as to why this is? I had imagined that (particularly with the ISDN router doing port forwarding) incoming packets would go to the e-smith server and it’s replies would go back the route they had come, I guess they are going back via the other router (and getting lost) because that is the default gateway? Why is this happening? In the end I set the gateway to the ISDN router so as not to loose mail and did method 2.

Method 2) Add an extra MX record to our domains DNS entry pointing to the ADSL line at a lower priority than the ISDN line but higher priority than the backup mail server. Once this had propagated, swap from the ISDN to the ADSL router and delete the MX record pointing to the ISDN line. After the router swap and while the second change was propagating any one trying to send us mail would find the highest priority mail server off line but would try the next one and find it OK.

Method 3) Change the MX record that pointed to the ISDN line so it pointed to the ADSL line and swap the router over immediately. During the period the DNS changes were propagating mail would fail to arrive at e-smith box but would end up at the backup mail server. To enable mail to arrive at the e-smith box from the backup server via the ADSL line add a temporary entry in the ‘host’ file on the backup server so it knew where to deliver the mail. I did not know where/which ‘host’ file to modify on an RH7.2+ensim based dedicated server so I did not try this method but I can’t see why it should not work.

Greg Zartman

Re: Changing IP external address of e-smith server and keepi
« Reply #1 on: July 18, 2003, 07:58:58 PM »
My best suggestion is to use a DNS service with email caching.  When assigned to this service, you'd simply plug the new WAN IP address into the DNS panel, then wait for the DNS to update itself.  Once the DNS is updated, email will start flowing from the cache.   My system has a servicelink subscription, which includes email caching (i.e, guaranteed email)  An alternate, and very good, service is easydns.com.  They charge $35/yr for full DNS service and email caching.

I've been using email caching DNS for over two years now and wouldn't think of trying to live without it.   My server as a pretty good uptime record, but outagages in one form or another are a certainty.

Greg

Kelvin

Re: Changing IP external address of e-smith server and keepi
« Reply #2 on: July 19, 2003, 10:20:36 AM »
Hi Mark,

>I guess they are going back via the other router (and getting lost) because that is
>the default gateway?

Correct.

>Why is this happening?

That's the way it's supposed to work with IP routing.

Idea behind default gateway is anything that is not automatically recognised is sent to the gateway for routing. So possibly (never tried this), if a static route was in place, then any traffic meant for a network that was covered by a static route will route the way you defined in the static route, and everything else goes out the default gateway. However, in spite of this, this would not work for your mail scenario due to the way SMTP mail works.

An intelligent load balancing router (ie. one that has multiple WAN side connections) like the Nexland proTurbo 800 might do the job (I cannot be sure as I've not tried one) as SME only sees the load balancer as the default gateway not the individual WAN connections. Or, you could play around with freeSCO or something like that.

Kelvin