expoweb/handbook/computing/netbookfakenet/fakenet2022/expo/masquerade

13 lines
399 B
Bash

#!/bin/sh -eux
. /root/fakenet/config
#(could configure ufw firewall here instead, or iptables)
#sudo ufw enable
sudo sysctl net.ipv4.ip_forward=1
#sudo iptables -I FORWARD -i eth0 -o wlan1 -s 10.0.1.0/24 -d 192.168.1.0/24 -j ACCEPT
#sudo iptables -I FORWARD -o eth0 -i wlan1 -d 10.0.1.0/24 -j ACCEPT
#sudo iptables -P FORWARD ACCEPT
sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE