sharing mobile data through usb tethering
#3
A script to try
Code:
#!/bin/bash
# Share the  internet connection from wwan0 through usb0

case "$1" in
    start)
ip link set usb0 up
ip a add 192.168.99.1/24 dev usb0
iptables --table nat --append POSTROUTING --out-interface wwan0 -j MASQUERADE
iptables --append FORWARD --in-interface usb0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "Set your PC's networking to"
echo "192.168.99.0/24"
echo "gateway 192.168.99.1"
echo "dns 192.168.99.1"   
;;
    stop)
echo 0 > /proc/sys/net/ipv4/ip_forward
ip link set usb0 down
iptables --table nat --delete POSTROUTING --out-interface wwan0 -j MASQUERADE
;;
    *)
echo "To start or stop sharing script usage: $0 {start|stop}"
;;
esac


Might need little changes. Easy to turn into touch friendly yad gui. Easy script to gui examples https://puri.sm/posts/easy-librem-5-app-...creenshot/ && https://puri.sm/posts/easy-librem-5-app-...he-screen/ Please improve and share.
  Reply


Messages In This Thread
RE: sharing mobile data through usb tethering - by vusra - 02-10-2022, 01:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pinephone seems tobe using 4G data instead of Wifi data grump_fiddle_reinstall 1 802 06-25-2024, 10:38 AM
Last Post: mikehenson
  Mobile internet via cellular network mostly not working Anna 18 13,597 01-19-2024, 02:59 AM
Last Post: anonymous
  4G data on default startup / boot dcinoz 1 1,192 04-29-2023, 11:24 PM
Last Post: dcinoz
  Block firefix-esr-mobile-config from (re)installing itself grump_fiddle_reinstall 3 2,225 01-07-2023, 09:36 AM
Last Post: dcarvil
Exclamation No modems were found: No mobile data, no 2G anonymous 2 1,966 12-26-2022, 06:46 PM
Last Post: anonymous
  very slow processing of MMS received via Ting (T-Mobile) treebeard 6 3,685 12-01-2022, 09:18 AM
Last Post: traut
  DNS Problems with Mobile Data arno_nuehm 29 21,139 10-29-2022, 09:16 AM
Last Post: treebeard
  Amberol Mobile Music player(flatpak) biketool 0 1,165 06-19-2022, 07:16 AM
Last Post: biketool
  Cellular data is working! drh 0 1,065 05-15-2022, 09:02 AM
Last Post: drh
  Reskinning Apps for Mobile biketool 6 4,376 12-05-2021, 02:30 PM
Last Post: biketool

Forum Jump:


Users browsing this thread: 1 Guest(s)