set -x tether=enp0s25 #inet=wlp4s0 inet=enp0s20u1c4i2 #ip addr add 192.168.0.1/24 broadcast 192.168.0.255 dev $tether ip link set up dev $tether ip addr add 192.168.0.1/24 dev $tether # run twice and you get the fugly RTNETLINK answers: File exists # configured in /etc/dhcpd.conf systemctl start dhcpd4@${tether}.service echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o $inet -j MASQUERADE iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i $tether -o $inet -j ACCEPT