wwan_connect.sh 430 Bytes
Newer Older
Martin Kepplinger's avatar
Martin Kepplinger committed
1
#!/bin/bash
Martin Kepplinger's avatar
Martin Kepplinger committed
2 3 4
MODEM_NR=$(sudo mmcli -L| cut -d / -f 6|cut -d ' ' -f 1)
echo "Modem Nr: $MODEM_NR"
sudo mmcli -m $MODEM_NR --simple-connect="apn=webaut,allow-roaming=true"
Martin Kepplinger's avatar
Martin Kepplinger committed
5 6
ADDR=$(sudo mmcli --bearer 0 | grep address | awk '{ print $3 }')
GW=$(mmcli --bearer 0 | grep gateway | awk '{ print $3 }')
Martin Kepplinger's avatar
Martin Kepplinger committed
7
echo "Configuring Addr $ADDR and Gw $GW"
Martin Kepplinger's avatar
Martin Kepplinger committed
8 9 10
sudo ifconfig wwan0 ${ADDR}/30
sudo route add default gw $GW
sudo resolvectl dns wwan0 8.8.8.8