another folder rename and add qmi-network.conf
This commit is contained in:
parent
dc7ce66aac
commit
0f77c610c0
|
@ -0,0 +1,3 @@
|
||||||
|
# Place this file in /etc/ (as /etc/qmi-network.conf)
|
||||||
|
APN=internet
|
||||||
|
PROXY=yes
|
|
@ -1,19 +1,51 @@
|
||||||
[Match]
|
# apt install --no-install-recommends libqmi-utils
|
||||||
Name=wwan0
|
# cp -v ./qmi-network@.service /etc/systemd/system/
|
||||||
|
# systemctl daemon-reload
|
||||||
|
# systemctl enable --now qmi-network@0
|
||||||
|
|
||||||
[Network]
|
# This will NOT work without a .network for your wwan device.
|
||||||
DHCP=yes
|
[Unit]
|
||||||
|
Description=qmi-network for cdc-wdm%i device
|
||||||
|
|
||||||
DNSOverTLS=opportunistic
|
Before=freepbx.service
|
||||||
|
Before=asterisk.service
|
||||||
|
|
||||||
DNS=1.1.1.1
|
After=sys-subsystem-net-devices-wwan%i.device
|
||||||
|
Wants=sys-subsystem-net-devices-wwan%i.device
|
||||||
|
|
||||||
DNS=1.0.0.1
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
TimeoutSec=300s
|
||||||
|
|
||||||
# Link discovery causes some issues so disable it.
|
# Make sure the state is cleared before starting.
|
||||||
LLDP=no
|
ExecStartPre=-rm /tmp/qmi-network-state-cdc-wdm%i
|
||||||
|
|
||||||
|
# Stop wwan so it can be reconfigured.
|
||||||
|
ExecStartPre=networkctl down wwan%i
|
||||||
|
|
||||||
|
# Raw IP must be enabled.
|
||||||
|
ExecStartPre=sh -c "echo 'Y' | tee /sys/class/net/wwan%i/qmi/raw_ip"
|
||||||
|
|
||||||
|
# Start the network via qmi-network scripts.
|
||||||
|
# As some networks and/or devices take a long time to connect we should
|
||||||
|
# give it some time to be ready before starting the connection process.
|
||||||
|
ExecStartPre=-sh -e -c "sleep 30; qmi-network /dev/cdc-wdm%i start"
|
||||||
|
|
||||||
|
# Bring up the network.
|
||||||
|
ExecStartPre=networkctl up wwan%i
|
||||||
|
|
||||||
|
# Small loop as the main process to watchdog the connection.
|
||||||
|
# (NOTE: DHCP must be given a little time to settle before pinging).
|
||||||
|
ExecStart=sh -e -c "sleep 5; while true; do ping -w 60 -I wwan%i -c 5 one.one.one.one; sleep 300; done;"
|
||||||
|
|
||||||
|
# Stop.. DOWN TIME!
|
||||||
|
ExecStop=networkctl down wwan%i
|
||||||
|
ExecStop=qmi-network /dev/cdc-wdm%i stop
|
||||||
|
# Be sure the network state is cleared on stop too.
|
||||||
|
ExecStop=-rm /tmp/qmi-network-state-cdc-wdm%i
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sys-subsystem-net-devices-wwan%i.device
|
||||||
|
|
||||||
[DHCP]
|
|
||||||
# Make sure connection/route is chosen last!
|
|
||||||
RouteMetric=2048
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue