2023 m. liepos 30 d., sekmadienis

NetworkStatus

Configuration files goes here:

/etc/NetworkManager/system-connections/
 

Default config:
$ sudo NetworkManager --print-config


Creating/modify new connection:

Add:

nmcli connection add type <con-type> <device> con-name <con-name>

nmcli connection add type gsm ifname ttyUSB2 con-name MyModem

Modify:

nmcli connection modify <con-name> ipv4.method manual ipv4.address <IP>/subnet


WIFI:

Wifi enable/disable status 

$ nmcli radio
WIFI-HW  WIFI     WWAN-HW  WWAN
enabled  enabled  enabled  enabled 

Showing all wifi connections with strengths: 

$ nmcli dev wifi list

$nmcli dev
DEVICE           TYPE      STATE         CONNECTION                   
wlp3s0           wifi      connected     connection-name 

 

Connecting disconnecting device 

$ mcli dev disconnect wlp3s0
$ nmcli dev connect wlp3s0  

Connecting to wifi network 

$ nmcli dev wifi connect SSID password SSID-PASSWORD ifname wlp3s0

How to change metric:

$ nmcli con mod "Wired connection 2" ipv4.route-metric 99

$ nmcli connection up "Wired connection 2"

To show metric:

$ route -n


Show Connection files:

$ nmcli -f name,device,FILENAME c | less

 

 

NetworkManager Configuration

# Debug
sudo /usr/sbin/ModemManager --debug 
$ nmcli con edit MyWorkingConnection
nmcli> set gsm.username data
nmcli> set gsm.password <passwordgoeshere>
nmcli> save
nmcli> quit

# Network Manager add device
sudo nmcli c add type gsm ifname '*' con-name usb0 apn internet

#List modems
mmcli -L

# Query modem
mmcli --modem=0

#Connect to bearer
sudo mmcli -m 0 --simple-connect='apn=internet'

# Show bearer
mmcli --modem=0 --bearer=0
# display information
nmcli d
ip a s usb0
nmcli --colors=yes c
mmcli -L
nmcli -f name,device,filename c


Documentation:

Redhad NetworkStatus Documentation

Examples

Cheatsheet  

https://adminscriptbank.wordpress.com/tag/nmcli/