Port Redirect with Public WAN and LAN



  • Hi,

    I have public ip's addresses on both WAN and LAN side. From there i want a rule that says:

    When connection is created to 123.123.123.123 port 26 on LAN from WAN, redirect it to 123.123.123.123 port 25 on LAN.

    I can't figure out how to set it up in NAT, as it only know how to forward when the lan is private.

    What can I do?

    Thanks



  • In my understanding there shouldn't be any difference whether addresses on LAN side are "public" or "private". But from your description I don't understand whether the address 123.123.123.123 is on LAN or WAN side of your network.

    If the addresses on LAN are truly meant to be public, reachable-from-the-internet addresses, then why use NAT at all? NAT is, after all, meant to masquerade the internal network so that it appears from the outside as single (or in some cases multiple) public address(es).



  • Better use private ips in Lan because you gonna have some problems if you use public ranges


  • Rebel Alliance Developer Netgate

    @leoalfa09:

    Better use private ips in Lan because you gonna have some problems if you use public ranges

    No, there are no problems using public IPs on the LAN.



  • But i experienced problems using NAT with a public range 168.132.20.0 in my lan, then i change to a private ip and NAT works


  • Rebel Alliance Developer Netgate

    @leoalfa09:

    But i experienced problems using NAT with a public range 168.132.20.0 in my lan, then i change to a private ip and NAT works

    If you had problems with that scenario, you were doing something wrong. There is no difference in what IPs you use on the LAN side. You may have had overlapping subnets or some other routing problem – but it was not related to using public IPs and NAT at the same time.



  • its nice to now that Thanks, maybe my problem with nat was other.

    Thanks..



  • You can setup port forwards just the same with public on both sides, I've done that a few times where someone wanted to send port 26 to port 25 on a public IP inside the network. The external and internal IPs are the same, just set the ports appropriately. That won't impact anything other than the specified external port.


Log in to reply