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
  Mobile internet via cellular network mostly not working Anna 18 10,499 01-19-2024, 02:59 AM
Last Post: anonymous
  4G data on default startup / boot dcinoz 1 858 04-29-2023, 11:24 PM
Last Post: dcinoz
  Block firefix-esr-mobile-config from (re)installing itself grump_fiddle_reinstall 3 1,603 01-07-2023, 09:36 AM
Last Post: dcarvil
Exclamation No modems were found: No mobile data, no 2G anonymous 2 1,408 12-26-2022, 06:46 PM
Last Post: anonymous
  very slow processing of MMS received via Ting (T-Mobile) treebeard 6 2,605 12-01-2022, 09:18 AM
Last Post: traut
  DNS Problems with Mobile Data arno_nuehm 29 17,221 10-29-2022, 09:16 AM
Last Post: treebeard
  Amberol Mobile Music player(flatpak) biketool 0 941 06-19-2022, 07:16 AM
Last Post: biketool
  Cellular data is working! drh 0 870 05-15-2022, 09:02 AM
Last Post: drh
  Reskinning Apps for Mobile biketool 6 3,488 12-05-2021, 02:30 PM
Last Post: biketool
  Mobile network mode setting not saved Zebulon Walton 3 3,084 12-05-2021, 12:12 AM
Last Post: bcnaz

Forum Jump:


Users browsing this thread: 1 Guest(s)