# ON laptop (tun0 instead of eth0 or eth1 for VPN): #sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" #sudo iptables -t nat -A POSTROUTING -o tun0 -s 192.168.2.11 -j MASQUERADE # stop default connman without USB support and start self-compiled version #sudo systemctl stop connman.service #sudo systemctl start net.connman.service # not needed with connman #/sbin/route add default gw 192.168.2.12 #sudo sh -c 'echo "nameserver 208.67.222.222 #nameserver 208.67.220.220" > /etc/resolv.conf' #ctl=/usr/lib/connman/tools/connmanctl ctl=connmanctl gadget=`$ctl services | grep gadget | cut -b 26- | tail -1` # if mobile network is disabled by default in self-compiled version #$ctl enable cellular $ctl config $gadget --ipv4 manual 192.168.2.11 255.255.255.0 192.168.2.12 --nameservers 208.67.222.222 208.67.220.220 $ctl connect $gadget