Linux Router
Posted by mazet on 09 Jul 2025 in Debian
Wlan configuration
Shell
echo >>/etc/network/interfaces <<EOF | |
# wifi | |
rename wlx14cc201f73d3=wlan0 | |
auto wlan0 | |
allow-hotplug wlan0 | |
iface wlan0 inet dhcp | |
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf | |
EOF | |
wpa_passphrase Softndesign2 P455W0rd >>/etc/wpa_supplicant/wpa_supplicant.conf |
Kernel configuration
Shell
sysctl -w net.ipv4.ip_forward=1 | |
sysctl -w net.ipv6.conf.all.forwarding=1 |
Firewalling rules
Shell
iptables -P FORWARD ACCEPT | |
iptables --table nat -A POSTROUTING -o wlan0 -j MASQUERADE | |
iptables-save >/var/lib/iptables/active |
DHCP configuration
Shell
sed -i 's/^\(option routers 192.168.0\)\..*/\1.3;/' /etc/dhcp/dhcpd.conf |