Bridge mit dummy interface: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| (4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
| − | = Fedora – | + | = Fedora – Internes NAT-Netz über Dummy-Interface = |
== Ziel == | == Ziel == | ||
| − | * | + | * Interface dummy0 mit 192.168.16.254/24 |
| − | |||
* NAT für 192.168.16.0/24 | * NAT für 192.168.16.0/24 | ||
| − | + | * Kein Bridge | |
| − | * Kein | + | * Vollständig NetworkManager + firewalld |
| − | * | ||
== Alte Konfiguration entfernen == | == Alte Konfiguration entfernen == | ||
| − | |||
*nmcli connection delete dummy0 2>/dev/null | *nmcli connection delete dummy0 2>/dev/null | ||
| − | |||
| − | == Dummy-Interface | + | == Dummy-Interface erstellen == |
| − | *nmcli connection add type dummy ifname dummy0 con-name dummy0 | + | *nmcli connection add type dummy ifname dummy0 con-name dummy0 ipv4.method manual ipv4.addresses 192.168.16.254/24 ipv6.method ignore |
| − | + | *nmcli connection up dummy0 | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | *nmcli connection | ||
| − | |||
| − | |||
| − | |||
== Kontrolle == | == Kontrolle == | ||
| − | *ip | + | *ip addr show dummy0 |
;Erwartet: | ;Erwartet: | ||
| + | *inet 192.168.16.254/24 vorhanden | ||
*state UP | *state UP | ||
| − | |||
== IP-Forwarding aktivieren == | == IP-Forwarding aktivieren == | ||
| Zeile 46: | Zeile 31: | ||
== Zonen setzen == | == Zonen setzen == | ||
| − | *nmcli connection modify | + | *nmcli connection modify dummy0 connection.zone internal |
*nmcli connection modify "<AKTIVE-CONNECTION>" connection.zone public | *nmcli connection modify "<AKTIVE-CONNECTION>" connection.zone public | ||
| − | *nmcli connection up | + | *nmcli connection up dummy0 |
*nmcli connection up "<AKTIVE-CONNECTION>" | *nmcli connection up "<AKTIVE-CONNECTION>" | ||
| Zeile 57: | Zeile 42: | ||
== Ergebnis == | == Ergebnis == | ||
| − | |||
*192.168.16.0/24 wird genattet | *192.168.16.0/24 wird genattet | ||
| − | *NAT funktioniert | + | *NAT funktioniert stabil |
Aktuelle Version vom 2. März 2026, 11:50 Uhr
Fedora – Internes NAT-Netz über Dummy-Interface
Ziel
- Interface dummy0 mit 192.168.16.254/24
- NAT für 192.168.16.0/24
- Kein Bridge
- Vollständig NetworkManager + firewalld
Alte Konfiguration entfernen
- nmcli connection delete dummy0 2>/dev/null
Dummy-Interface erstellen
- nmcli connection add type dummy ifname dummy0 con-name dummy0 ipv4.method manual ipv4.addresses 192.168.16.254/24 ipv6.method ignore
- nmcli connection up dummy0
Kontrolle
- ip addr show dummy0
- Erwartet
- inet 192.168.16.254/24 vorhanden
- state UP
IP-Forwarding aktivieren
- echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/99-ipforward.conf
- sysctl --system
Aktive Uplink-Connection ermitteln
- nmcli connection show --active
- Connection mit Default-Route merken
Zonen setzen
- nmcli connection modify dummy0 connection.zone internal
- nmcli connection modify "<AKTIVE-CONNECTION>" connection.zone public
- nmcli connection up dummy0
- nmcli connection up "<AKTIVE-CONNECTION>"
NAT aktivieren
- firewall-cmd --permanent --zone=public --add-masquerade
- firewall-cmd --permanent --zone=internal --add-forward
- firewall-cmd --reload
Ergebnis
- 192.168.16.0/24 wird genattet
- NAT funktioniert stabil