How long does the router keep entries in NAT and can they reuse forwarding requests from other hosts?

There is an answer explaining in simple words how the router works, transferring requests from the local network to the external and vice versa ( https://superuser.com/questions/105838/how-does-router-know-where-to-forward-packet ), what is not clear - for how long does the entry in NAT last?

For example, if I send a UDP request to 25.34.11.56:3874 and my local endpoint is 192.168.1.21β–Ί4389, the router overwrites the request packet and adds the entry to NAT. Let's say the outer endpoint is 68.55.32.89 opin4535. Then the computer that received my request responds to 68.55.32.89βˆ—4535 and the packet that it forwarded to local 192.168.1.21β–Ί4389 in accordance with the NAT record. What happens after that in the recording?

What if 25.34.11.56:3874 decides to send a request to my external endpoint 68.55.32.89haps4535 in 10 or 100 minutes? Will it still be redirected by the router to 192.168.1.21/104389?

Let's say there is another remote computer with an endpoint of 55.43.77.98:8765. What happens if this computer sends a request to my external endpoint 68.55.32.89 opin4535? Will it be redirected to local 192.168.1.21و4389 or will it be filtered by the router because the remote endpoint does not match 25.34.11.56:3874, which was originally used for the first request and for NAT recording?

+4
source share
1 answer

It depends.

According to Section 4.3 of RFC 4787 , the UDP timeout for NAT must be at least 2 minutes (180 seconds), with the exception of selected, known ports. In practice, however, routers typically use less timeouts. For example, OpenWRT 14.07 uses a timeout of just 60 seconds.

TCP , TCP- FIN/FIN-ACK. TCP- 5 RFC 5382 - 2 4 (7204 ), OpenWRT 7440 .

NAT , ( ). A NAT B, A B - C NAT A. ( NAT, , .)

+5

Source: https://habr.com/ru/post/1589042/


All Articles