I am not very good in the nat, so need som help if its possible.
I have a router with a public IP on interface ether1.
On inside I have two server.
Server 1 Linux server (172.16.1.10) with only need for web port 22 trough NAT. Simple dest nat.
Server 2 Web server (172.16.1.20) I need port 443 from public IP to the server without NAT.
This way server 2 would see the public IP
You need src-nat and dst-nat rules…
The first one, is used so that the server is src nated using the Public IP you want, and the later to dst-nat all the incoming traffic to that Public IP to the Server…
Jotne, you want to forward public port 443 packets to 172.16.1.20 which is a private IP address without nat. Sorry, not possible - you can’t have your cake and eat it too The main reason is that the return source addr 172.16.1.20 will be dropped upstreams.
I want the above rule to work so inside to outside nat and nat to the sever1.
Since server2 is a web server, I like the webserver to see the public source IP, so that logging of usage would be correct.
Sorry my bad, I didn’t manage to complete my answer but the main reason this won’t work is that the return source address 172.16.1.20 will be dropped upstreams since it belongs to a private address range.
Also, in your case, the src-nat rule is not actually needed because you have a general masquerade rule… if you add it though, just place it before the masquerade one so that you can see it works ( packets counting )…