1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

port mapping + snat?

Discussion in 'Tomato Firmware' started by rs232, Aug 17, 2012.

  1. rs232

    rs232 Network Guru Member

    I'm trying to do something a bit difficult (to me at least)

    I have two default gateways in my LAN (both tomato) and all the hosts use gw1 as default gateway apart from a specific one that uses gw2 instead. So:

    LAN: 192.168.0.0/24
    gw1 192.168.0.1
    gw2 192.168.0.2
    host: 192.168.0.100

    The problem is: I'd like to map an external port on gw1 to this host, but this will not work as the source IP comes from Internet and the host will respond sending packets to gw2.

    I was thinking... would it be possible to source nat (only) the port I'm forwarding from gw1 to host?
    This way I fool host to think that the source IP is actually gw1, and when the packet returns to gw1 this is de-natted and sent back to the real source IP.

    I hope I've explained myself.
    rs232
     
  2. rs232

    rs232 Network Guru Member

    it wasn't that difficult actually:
    did it nicely!
     

Share This Page