~cyplo/dotfiles

ref: 83ddcc09dc68389b129d598722eca9e90a6dff33 dotfiles/tools/armory_masq -rwxr-xr-x 402 bytes
83ddcc09 — Cyryl Płotnicki remove broken i3 msg call 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
set -e
set -v
if [[ -z "$USB_INTERFACE" ]]; then
    USB_INTERFACE=usb0
fi

if [[ -z "$INTERNET_INTERFACE" ]]; then
    INTERNET_INTERFACE=wlan0
fi

sudo /sbin/ip link set $USB_INTERFACE up

sudo /sbin/ip addr add 10.0.0.2/24 dev $USB_INTERFACE

sudo /sbin/iptables -t nat -A POSTROUTING -s 10.0.0.1/32 -o $INTERNET_INTERFACE -j MASQUERADE

echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward