networking:mikrotik:hairpin_nat
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| networking:mikrotik:hairpin_nat [2021/05/13 13:01] – rplecko | networking:mikrotik:hairpin_nat [2021/05/19 17:30] (current) – rplecko | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| In the below network topology a web server behind a router is on private IP address space, and the router performs NAT (dst-nat) to forward traffic which was destined to its public IP address, to the web server behind it (on local network). | In the below network topology a web server behind a router is on private IP address space, and the router performs NAT (dst-nat) to forward traffic which was destined to its public IP address, to the web server behind it (on local network). | ||
| - | [[http:// | + | [[http:// |
| **The NAT configuration would look like below:** | **The NAT configuration would look like below:** | ||
| Line 48: | Line 48: | ||
| </ | </ | ||
| + | |||
| + | With that additional rule, the flow now changes: | ||
| |Step^Source IP address^Destination IP address^Description| | |Step^Source IP address^Destination IP address^Description| | ||
| Line 55: | Line 57: | ||
| ^04|1.1.1.1|192.168.0.1|the router determines that the packet is part of a previous connection and undoes both the source and destination NAT, and puts the original destination IP address of <fc # | ^04|1.1.1.1|192.168.0.1|the router determines that the packet is part of a previous connection and undoes both the source and destination NAT, and puts the original destination IP address of <fc # | ||
| - | With that additional rule, the flow now changes: | ||
| - | |||
| - | - the client sends a packet with a source IP address of <fc # | ||
| - | - the router destination NATs the packet to <fc # | ||
| - | - the web server replies to the request and sends the reply with a source IP address of <fc # | ||
| - | - the router determines that the packet is part of a previous connection and undoes both the source and destination NAT, and puts the original destination IP address of <fc # | ||
| The client receives the reply packet it expects, and the connection is established. | The client receives the reply packet it expects, and the connection is established. | ||
networking/mikrotik/hairpin_nat.1620910889.txt.gz · Last modified: 2021/05/13 13:01 by rplecko
