8

I'm trying to make an image for a device that includes a NetworkManager connection for an LTE modem.

I've created a config file for the connection:

[connection]
id=modem
uuid=4b5f7f0b-1c58-4fa3-bc3c-45a3e3d329d8
type=gsm
interface-name=ttyACM0
permissions=

[gsm]
apn=XXXXXXXXXXXXX
number=XXXXXXXXXXXXxx

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

and placed this at /etc/NetworkManager/system-connections/modem which is what the normal nmcli con add command would do. However when booting up this image, NetworkManager shows no connections:

root@bionic-armhf:~# nmcli c show
NAME  UUID  TYPE  DEVICE

I've also tried restarting the service.

Is there something I'm missing? Is there a way to do this without manually creating the connection or creating it via a startup script? Ideally it would be done all through config files.

4
  • permissions shouldn't be empty.
    – Pilot6
    Mar 6, 2019 at 20:22
  • @Pilot6 Thanks for the input. So interestingly, this file I've pasted here is what is generated by nmcli con add. If i run that command to generate this file on the deployed system, it knows about the connection even though permissions is empty. Mar 6, 2019 at 20:31
  • Did you restart NM?
    – Pilot6
    Mar 6, 2019 at 20:35
  • @Pilot6 yes. Actually your previous point about permissions helped me in a different way. I forgot to set the file permissions for the file properly which seems to be the cause of the issue. Thank you! Mar 6, 2019 at 20:38

1 Answer 1

7

Upon further examination, I had forgotten to set the file permissions properly.

chmod 600 /etc/NetworkManager/system-connections/modem

Fixed the issue I was having. I just made the perms match what nmcli con add creates by default.

Note that the owner and group of the file must also be set to root, and you must reissue a nmcli conn reload after adding a file or fixing permissions. You can see the currently loaded definitions using nmcli conn show.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .