Austausch: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „=Info= *Alle Befehle als root ausführen =Schritt 1= *Installiere iptables auf der Firewall apt install iptables =Schritt 2= *füge folgendes Skript unter ''…“) |
|||
| Zeile 1: | Zeile 1: | ||
| + | =Nach der Firewall - DHCP= | ||
| + | *[[DHCP Austausch]] | ||
=Info= | =Info= | ||
*Alle Befehle als root ausführen | *Alle Befehle als root ausführen | ||
Version vom 21. März 2025, 09:16 Uhr
Nach der Firewall - DHCP
Info
- Alle Befehle als root ausführen
Schritt 1
- Installiere iptables auf der Firewall
apt install iptables
Schritt 2
- füge folgendes Skript unter nano /usr/local/sbin/firewall
#!/bin/bash # Interfaces WAN_IF="enp0s3" CLIENT_IF="enp0s8" SERVER_IF="enp0s9" # Netzwerke CLIENT_NET="10.22.1.0/28" SERVER_NET="192.168.5.0/26" # Flush all existing rules iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X # Default Policies iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT # Masquerading für Internetzugriff iptables -t nat -A POSTROUTING -s $CLIENT_NET -o $WAN_IF -j MASQUERADE iptables -t nat -A POSTROUTING -s $SERVER_NET -o $WAN_IF -j MASQUERADE
Schritt 3
- Mache die Datei ausführbar
chmod +x /usr/local/sbin/firewall
Schritt 4
- Datei ausführen
firewall
Schritt 5
- Öffnen der sysctl.conf
sudo nano /etc/sysctl.conf
Schritt 6
- Suche die Zeile #net.ipv4.ip_forward=1 und entferne das Raute-Symbol
net.ipv4.ip_forward=1
- Datei abspeichern
Schritt 7
- Änderungen aktivieren
sysctl -p