#!/bin/bash set -e set -v USB_INTERFACE=enp0s20u3 INTERNET_INTERFACE=wlp3s0 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