SNAT: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 12: | Zeile 12: | ||
=Iptables Beispiele= | =Iptables Beispiele= | ||
| + | ==Masquerading== | ||
| + | *iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o $WAN -j MASQUERADE | ||
| + | ==Natives SNAT== | ||
| + | *iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o $WAN -j SNAT --to 62.54.32.67 | ||
| + | ==SNAT ganzes Netz== | ||
| + | *iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o $WAN -j NETMAP --to 62.54.32.0/24 | ||
Version vom 8. Juli 2022, 10:37 Uhr
Grundlegendes
- Wenn die Quelladresse des ersten Pakets verändert wird, ist das Source NAT
- Manverändert den Ursprung der Verbindung.
- Source NAT ist immer Post-Routing-Kette.
- Es wirkt, gerade bevor das Paket in die Leitung geht.
- Masquerading ist eine spezielle Form von SNAT.
Schaubilder
Masquerading
SNAT ganzes Netz
Iptables Beispiele
Masquerading
- iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o $WAN -j MASQUERADE
Natives SNAT
- iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o $WAN -j SNAT --to 62.54.32.67
SNAT ganzes Netz
- iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o $WAN -j NETMAP --to 62.54.32.0/24

