Bridge mit dummy interface: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| (2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
| − | = Fedora – Internes NAT-Netz | + | = Fedora – Internes NAT-Netz über Dummy-Interface = |
== Ziel == | == Ziel == | ||
| − | * Interface | + | * 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 | + | * Kein Bridge |
| − | + | * Vollständig NetworkManager + firewalld | |
| − | * Vollständig NetworkManager | ||
== Alte Konfiguration entfernen == | == Alte Konfiguration entfernen == | ||
| − | *nmcli connection delete | + | *nmcli connection delete dummy0 2>/dev/null |
| − | == | + | == Dummy-Interface erstellen == |
| − | *nmcli connection add type | + | *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 up | ||
== Kontrolle == | == Kontrolle == | ||
| − | *ip addr show | + | *ip addr show dummy0 |
;Erwartet: | ;Erwartet: | ||
| − | *192.168.16.254/24 vorhanden | + | *inet 192.168.16.254/24 vorhanden |
*state UP | *state UP | ||
| Zeile 35: | 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 47: | Zeile 43: | ||
== Ergebnis == | == Ergebnis == | ||
*192.168.16.0/24 wird genattet | *192.168.16.0/24 wird genattet | ||
| − | |||
| − | |||
| − | |||
*NAT funktioniert stabil | *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