My simple understanding of NAT is something like this could happen:
Two client PCs 192.168.1.2 and 192.168.1.3 open up a connection with src port = 12345. The gateway receives these and needs to use NAT, so one of them stays as 12345 and the other stays as 12346 when it goes out on the external IP 184.108.40.206.
192.168.1.2:12345 220.127.116.11:12345 <-> 18.104.22.168:80 -----> 192.168.1.1 -----> 192.168.1.3:12345 22.214.171.124:12346 <-> 126.96.36.199:443
When the packets come back in to 188.8.131.52 it has to map to the correct internal IP and port. This would need some kind of mapping table.
I wonder, how long would that table typically last?
- x Minutes/Hours?
- Until it sees a connection close down?
So for example if I have a protocol that irregularly sends data either way, is there a risk the mapping has gone and the other side sees the connection as closed (gets no Ack)?
In Linux, is there a way to see this table?