How to setup static PAT (not forwarding)?

Hello, currently I bumped into a one Internet service which requires all UDP requests to come from specific single source port.
On my PC I can bind socket to this specific port, but the router with default masquerade/nat rules translates this port to random one. As a result, each outgoing UDP packet have a different source port.
Is it possible to make a static outgoing port translation rule so all packets to specific external IP will originate from a single specific source port?
Or, if possible, to narrow down - if packet originates from local network, it has src port = X, then masquerade it but keep source port = X…
Playing with src-nat, there’s only ‘target port’ in action

The src port is usually altered to allow the src socket to remain unique. If all requests to a target socket (target IP / port pair) are from the same source socket (source IP / port pair) then the sessions cannot be differentiated.

I already know all that, would be grateful if you answered the specific technical question I asked instead of teaching the basics…

For now, it seems src-nat is working, and ‘to-port’ just refers to local port for src-nat action. Packet sniffer shows that outgoing packets all have the same source port, before creating the rule these ports were random.
Now I’m waiting for that external server to raise the ban to see if everything works as expected (my ip was banned while I was testing various settings)

Yes - the To Port should allow you to specify the outgoing src port. When people post in Beginners Basics one can hardly assume that they “know all that”. :slight_smile: