Let' say we have two instances of webserver listening on port 80 and 81 and I want to seamlessly redirect customer traffic without losing any packets from instance1 to instance2.
My understanding that simple NEW match would work.Is it correct?
$ iptables -A PREROUTING -t nat -p tcp --dport 80 -m state --state NEW -j REDIRECT --to-port 81
I expect old connection to be open until they are closed and any new connections would be redirected to the new port.