Files
meta-diya/recipes-devtools/usbnet-tools/files/pinephone-setup-usb-network
Dany LE ab8921d052 Major update:
- Switch to Sytemd
- Add development tools: adroid tool, usbgadget support
- Rework on recovery Image
2025-11-26 17:55:25 +01:00

22 lines
777 B
Bash

#!/bin/sh
if [ ! -e /etc/NetworkManager/system-connections/USB.nmconnection ]; then
# Create network connection
nmcli connection add con-name USB \
ifname usb0 \
type ethernet \
ip4 192.168.100.1/16
# Set priorities so it doesn't take precedence over WiFi/mobile connections
nmcli connection modify USB ipv4.route-metric 1500
nmcli connection modify USB ipv4.dns-priority 150
# Auto connection so it can be used for tethering
nmcli connection modify USB ipv4.method shared
nmcli connection modify USB connection.autoconnect yes
# nmcli con add con-name "modem" type "gsm" ifname "wwan0qmi0"
fi
# set up ip forward
sysctl -w net.ipv4.ip_forward=1
nmcli con up USB