Page 1 of 1
how does the masquerade work
Posted: Sat May 22, 2021 10:20 pm
by looka
i know, silly question. "masquerade is a special src-nat for dynamic public IPs".
but, if I have more than one public IP and only one rule, which masquerades all traffic, is it going to work? which IP does the masquerade choose and how?
Re: how does the masquerade work
Posted: Sat May 22, 2021 10:32 pm
by Hominidae
...by keeping track of existing connections, once established...these contain IPs and Ports for source and destination.each.
Re: how does the masquerade work
Posted: Sat May 22, 2021 10:54 pm
by anav
I use a masquerade rule per ISP. For example I have one for cable and one for Fiber both dynamic.
one could use an interface-list=WAN , the standard default rule and this will work as well.
As to the second question, sourcenat doesnt tell the router where to send traffic it only tells the router if traffic is going out an interface to assign the outgoing interface public IP to the connection for connection tracking purposes (return traffic). ROUTING decides where traffic is directed.