baptx

internet_usb_receive.sh

Jan 3rd, 2018
192
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # ON laptop (tun0 instead of eth0 or eth1 for VPN):
  2. #sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
  3. #sudo iptables -t nat -A POSTROUTING -o tun0 -s 192.168.2.11 -j MASQUERADE
  4.  
  5. # stop default connman without USB support and start self-compiled version
  6. #sudo systemctl stop connman.service
  7. #sudo systemctl start net.connman.service
  8.  
  9. # not needed with connman
  10. #/sbin/route add default gw 192.168.2.12
  11. #sudo sh -c 'echo "nameserver 208.67.222.222
  12. #nameserver 208.67.220.220" > /etc/resolv.conf'
  13.  
  14. #ctl=/usr/lib/connman/tools/connmanctl
  15. ctl=connmanctl
  16. gadget=`$ctl services | grep gadget | cut -b 26- | tail -1`
  17.  
  18. # if mobile network is disabled by default in self-compiled version
  19. #$ctl enable cellular
  20.  
  21. $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
  22. $ctl connect $gadget
RAW Paste Data