PUB_IF="eth0"
WG_IF="wg0"
# Forward incoming UDP:8964 on public IP → laptop (10.7.0.2:8964)
sudo iptables -t nat -A PREROUTING -i $PUB_IF -p udp --dport 8964 -j DNAT --to-destination 10.7.0.2:8964
# Allow the traffic to be forwarded
sudo iptables -A FORWARD -i $PUB_IF -o $WG_IF -p udp --dport 8964 -d 10.7.0.2 -j ACCEPT
# Masquerade (so return packets go back through VPS)
sudo iptables -t nat -A POSTROUTING -o $WG_IF -p udp --dport 8964 -d 10.7.0.2 -j MASQUERADE
# check status
sudo iptables -t nat -L -n -v
sudo iptables -L -n -v- Install deps
sudo apt install chromium-browser chromium-codecs-ffmpegand specify flags and path
const browser = await puppeteer.launch({
headless: true,
executablePath: '/usr/bin/chromium-browser',
args: ['--no-sandbox', '--disable-setuid-sandbox']
});in non headless mode you can Install xvfb
sudo apt install xvfb x11-apps x11-xkb-utils libx11-6 libx11-xcb1Then run the following command
Xvfb -ac :99 -screen 0 1280x1024x16 & export DISPLAY=:99sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport 3124 -j DNAT --to-destination 10.7.0.3:80
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -L -n -t nat
iptables -t nat -F && iptables -F
sudo wg-quick up wg0
sudo wg-quick down wg0
sudo install -o root -g root -m 600 ~/Downloads/desktop.conf /etc/wireguard/wg0.conf
sudo wg show
sudo systemctl enable wg-quick@wg0.service
sudo systemctl daemon-reload
sudo systemctl start wg-quick@wg0sudo apt install openresolv- create two adapters that is adapter1 with NAT and adapter 2 with host only network lets say vboxnet0 with ip range as (192.168.56.3/3) lower and upper respectively.
- copy yaml below to /etc/netplan/00-installer-config.yaml
network:
ethernets:
enp0s3:
dhcp4: true
enp0s7:
addresses:
- 192.168.57.1/24
dhcp4: no
enp0s8:
addresses:
- 192.168.56.1/24
dhcp4: no
version: 2
then finalize
sudo netplan try
sudo netplan generate
sudo netplan apply