Routing – Cisco NAT of Source and Destination Addresses

cisco-iosnat;routerrouting

I thought I had a relatively simple question, however I can't seem to find a solution online easily.

My problem is: I have two Cisco 1941 routers configured each with their own direct internet facing connection. Lets assume R0 is the default gateway, and R1 acts as a backup connection. I want to be able to receive traffic from both Internet connections to my mail server. As the mail server has a default gateway of R0, if it receives traffic from R1 it will not make it back to the originator.

Logically I'm thinking this can be achieved by NAT on the source side of the Internet address so that routing is not used, and the server can get back to the router via the NAT IP address, which would be on the same subnet.

My starting configuration is this:

Simple config

R0 configuration:

gigabitethernet0/0
 ip address 192.168.200.1
 ip nat inside

Dialer0
 ip nat outside

ip nat inside source list 190 interface dialer0
ip nat inside source static tcp 192.168.200.10 25 interface dialer0 25
access-list 190 permit ip 192.168.200.0 255.255.255.0 any

R1 configuration:

gigabitethernet0/0
 ip address 192.168.200.2
 ip nat inside

Dialer0
 ip nat outside

ip nat inside source list 190 interface dialer0
ip nat inside source static tcp 192.168.200.10 25 interface dialer0 25
access-list 190 permit ip 192.168.200.0 255.255.255.0 any

My Mail Server is 192.168.200.10.

Any help appreciated.

Best Answer

To do this -- eliminate the asymmetric routing -- you have to double NAT ("twice NAT") the packet. First NAT rewrites the destination (internet-to-internal), and the second rewrites the source to the transiting router. I've had to do that before; on IOS, it's a complex pain in the ass. I've seen examples using ip nat inside and ip nat outside at the same time, but I'm not sure that'll do both to the same packet. (which is why I resorted to complicated loopback interfaces)

(If you can get your hands on an ASA running 8.3+, the screwed up "new NAT" can do source and destination rewriting in one command. It's the only up-side to that insanity.)

Related Topic