Manual creation of NetworkManager connection file fails (Error: Unknown connection)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite
4












Objective: I am trying to set up a 3G connection using NetworkManager 0.9.4 via command line. I have previously succeeded (see this question) by setting up the connection through the nm-applet (GUI in X) but now I need to replicate this on many machines and therefore want to do it via command line as part of an installation bash script that does this among other things.



My approach: I have written a bash script that creates this connection file and places it in /etc/NetworkManager/system-connections/:



[connection]
id=viettel
uuid=df62d4f8-0699-11e5-8996-ab1b9b4c6754
type=gsm
autoconnect=false
[ppp]
lcp-echo-failure=5
lcp-echo-interval=30
[ipv4]
method=auto
[serial]
baud=115200
[gsm]
number=*99#
password-flags=1
apn=e-connect


The file looks exactly like the (working) file created by the GUI tool before.



I added monitor-connection-files=yes to /etc/NetworkManager/NetworkManager.conf so NM would notice changed configuration files during runtime.



Problem: However, when trying to establish a connection (sudo nmcli con up id viettel), I get this error:




Error: Unknown connection: viettel.




And indeed, when running sudo nmcli con list to see the connections that NM is aware of, I get an empty list:




NAME UUID TYPE TIMESTAMP-REAL




I saw that some people recommend running nmcli con reload to refresh this list but that command is not available in the latest stable NM package for my system (see below) and it shouldn't be needed with monitor-connection-files=yes anyway, as far as I understand. I tried restarting the NM service and rebooting, both without success.



So it looks like NM is simply not looking for the connection file in the right place or has some sort of list of available connections that was not refreshed after the new file was added.



My question: How do I make NM aware of the new connection file? Any other advice what to do next?



System information: I am running this on a Raspberry Pi 2 with Raspbian Wheezy (all packages updated). NetworkManager is version 0.9.4 (I saw that there are a newer versions available but apparently not released as stable debian package for the RPi)



Thanks a lot for you help!










share|improve this question



























    up vote
    3
    down vote

    favorite
    4












    Objective: I am trying to set up a 3G connection using NetworkManager 0.9.4 via command line. I have previously succeeded (see this question) by setting up the connection through the nm-applet (GUI in X) but now I need to replicate this on many machines and therefore want to do it via command line as part of an installation bash script that does this among other things.



    My approach: I have written a bash script that creates this connection file and places it in /etc/NetworkManager/system-connections/:



    [connection]
    id=viettel
    uuid=df62d4f8-0699-11e5-8996-ab1b9b4c6754
    type=gsm
    autoconnect=false
    [ppp]
    lcp-echo-failure=5
    lcp-echo-interval=30
    [ipv4]
    method=auto
    [serial]
    baud=115200
    [gsm]
    number=*99#
    password-flags=1
    apn=e-connect


    The file looks exactly like the (working) file created by the GUI tool before.



    I added monitor-connection-files=yes to /etc/NetworkManager/NetworkManager.conf so NM would notice changed configuration files during runtime.



    Problem: However, when trying to establish a connection (sudo nmcli con up id viettel), I get this error:




    Error: Unknown connection: viettel.




    And indeed, when running sudo nmcli con list to see the connections that NM is aware of, I get an empty list:




    NAME UUID TYPE TIMESTAMP-REAL




    I saw that some people recommend running nmcli con reload to refresh this list but that command is not available in the latest stable NM package for my system (see below) and it shouldn't be needed with monitor-connection-files=yes anyway, as far as I understand. I tried restarting the NM service and rebooting, both without success.



    So it looks like NM is simply not looking for the connection file in the right place or has some sort of list of available connections that was not refreshed after the new file was added.



    My question: How do I make NM aware of the new connection file? Any other advice what to do next?



    System information: I am running this on a Raspberry Pi 2 with Raspbian Wheezy (all packages updated). NetworkManager is version 0.9.4 (I saw that there are a newer versions available but apparently not released as stable debian package for the RPi)



    Thanks a lot for you help!










    share|improve this question

























      up vote
      3
      down vote

      favorite
      4









      up vote
      3
      down vote

      favorite
      4






      4





      Objective: I am trying to set up a 3G connection using NetworkManager 0.9.4 via command line. I have previously succeeded (see this question) by setting up the connection through the nm-applet (GUI in X) but now I need to replicate this on many machines and therefore want to do it via command line as part of an installation bash script that does this among other things.



      My approach: I have written a bash script that creates this connection file and places it in /etc/NetworkManager/system-connections/:



      [connection]
      id=viettel
      uuid=df62d4f8-0699-11e5-8996-ab1b9b4c6754
      type=gsm
      autoconnect=false
      [ppp]
      lcp-echo-failure=5
      lcp-echo-interval=30
      [ipv4]
      method=auto
      [serial]
      baud=115200
      [gsm]
      number=*99#
      password-flags=1
      apn=e-connect


      The file looks exactly like the (working) file created by the GUI tool before.



      I added monitor-connection-files=yes to /etc/NetworkManager/NetworkManager.conf so NM would notice changed configuration files during runtime.



      Problem: However, when trying to establish a connection (sudo nmcli con up id viettel), I get this error:




      Error: Unknown connection: viettel.




      And indeed, when running sudo nmcli con list to see the connections that NM is aware of, I get an empty list:




      NAME UUID TYPE TIMESTAMP-REAL




      I saw that some people recommend running nmcli con reload to refresh this list but that command is not available in the latest stable NM package for my system (see below) and it shouldn't be needed with monitor-connection-files=yes anyway, as far as I understand. I tried restarting the NM service and rebooting, both without success.



      So it looks like NM is simply not looking for the connection file in the right place or has some sort of list of available connections that was not refreshed after the new file was added.



      My question: How do I make NM aware of the new connection file? Any other advice what to do next?



      System information: I am running this on a Raspberry Pi 2 with Raspbian Wheezy (all packages updated). NetworkManager is version 0.9.4 (I saw that there are a newer versions available but apparently not released as stable debian package for the RPi)



      Thanks a lot for you help!










      share|improve this question















      Objective: I am trying to set up a 3G connection using NetworkManager 0.9.4 via command line. I have previously succeeded (see this question) by setting up the connection through the nm-applet (GUI in X) but now I need to replicate this on many machines and therefore want to do it via command line as part of an installation bash script that does this among other things.



      My approach: I have written a bash script that creates this connection file and places it in /etc/NetworkManager/system-connections/:



      [connection]
      id=viettel
      uuid=df62d4f8-0699-11e5-8996-ab1b9b4c6754
      type=gsm
      autoconnect=false
      [ppp]
      lcp-echo-failure=5
      lcp-echo-interval=30
      [ipv4]
      method=auto
      [serial]
      baud=115200
      [gsm]
      number=*99#
      password-flags=1
      apn=e-connect


      The file looks exactly like the (working) file created by the GUI tool before.



      I added monitor-connection-files=yes to /etc/NetworkManager/NetworkManager.conf so NM would notice changed configuration files during runtime.



      Problem: However, when trying to establish a connection (sudo nmcli con up id viettel), I get this error:




      Error: Unknown connection: viettel.




      And indeed, when running sudo nmcli con list to see the connections that NM is aware of, I get an empty list:




      NAME UUID TYPE TIMESTAMP-REAL




      I saw that some people recommend running nmcli con reload to refresh this list but that command is not available in the latest stable NM package for my system (see below) and it shouldn't be needed with monitor-connection-files=yes anyway, as far as I understand. I tried restarting the NM service and rebooting, both without success.



      So it looks like NM is simply not looking for the connection file in the right place or has some sort of list of available connections that was not refreshed after the new file was added.



      My question: How do I make NM aware of the new connection file? Any other advice what to do next?



      System information: I am running this on a Raspberry Pi 2 with Raspbian Wheezy (all packages updated). NetworkManager is version 0.9.4 (I saw that there are a newer versions available but apparently not released as stable debian package for the RPi)



      Thanks a lot for you help!







      debian networking command-line raspberry-pi networkmanager






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:36









      Community♦

      1




      1










      asked May 30 '15 at 8:23









      nhee

      1288




      1288




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          The NetworkManager.conf man page notes of the base config file plugin:




          For security, it will ignore files
          that are readable or writeable by any user or group other than root.




          In this case the result is "Unknown connection". chown your connection to root and chmod it 0600 to match those created by NetworkManager.



          More generally, connection files are very sensitive to spelling and nmcli a) will ignore a connection entirely if anything is wrong and b) won't tell you about typos in its normal output. However, see /var/syslog (default, configurable) for NetworkManager messages NetworkManager doesn't seem to notice permission or ownership changes on their own so touch the file to have it re-scanned in those cases.



          I had created a connection file with the incorrect line



          key-mgmt=wpa2-psk


          ...that value should have been simply "wpa-psk" and only the log file had been telling me where the problem was:




          Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: updating /etc/NetworkManager/system-connections/ATT2

          Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: error: invalid or missing connection property 'key-mgmt'







          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f206468%2fmanual-creation-of-networkmanager-connection-file-fails-error-unknown-connecti%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            The NetworkManager.conf man page notes of the base config file plugin:




            For security, it will ignore files
            that are readable or writeable by any user or group other than root.




            In this case the result is "Unknown connection". chown your connection to root and chmod it 0600 to match those created by NetworkManager.



            More generally, connection files are very sensitive to spelling and nmcli a) will ignore a connection entirely if anything is wrong and b) won't tell you about typos in its normal output. However, see /var/syslog (default, configurable) for NetworkManager messages NetworkManager doesn't seem to notice permission or ownership changes on their own so touch the file to have it re-scanned in those cases.



            I had created a connection file with the incorrect line



            key-mgmt=wpa2-psk


            ...that value should have been simply "wpa-psk" and only the log file had been telling me where the problem was:




            Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: updating /etc/NetworkManager/system-connections/ATT2

            Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: error: invalid or missing connection property 'key-mgmt'







            share|improve this answer


























              up vote
              1
              down vote













              The NetworkManager.conf man page notes of the base config file plugin:




              For security, it will ignore files
              that are readable or writeable by any user or group other than root.




              In this case the result is "Unknown connection". chown your connection to root and chmod it 0600 to match those created by NetworkManager.



              More generally, connection files are very sensitive to spelling and nmcli a) will ignore a connection entirely if anything is wrong and b) won't tell you about typos in its normal output. However, see /var/syslog (default, configurable) for NetworkManager messages NetworkManager doesn't seem to notice permission or ownership changes on their own so touch the file to have it re-scanned in those cases.



              I had created a connection file with the incorrect line



              key-mgmt=wpa2-psk


              ...that value should have been simply "wpa-psk" and only the log file had been telling me where the problem was:




              Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: updating /etc/NetworkManager/system-connections/ATT2

              Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: error: invalid or missing connection property 'key-mgmt'







              share|improve this answer
























                up vote
                1
                down vote










                up vote
                1
                down vote









                The NetworkManager.conf man page notes of the base config file plugin:




                For security, it will ignore files
                that are readable or writeable by any user or group other than root.




                In this case the result is "Unknown connection". chown your connection to root and chmod it 0600 to match those created by NetworkManager.



                More generally, connection files are very sensitive to spelling and nmcli a) will ignore a connection entirely if anything is wrong and b) won't tell you about typos in its normal output. However, see /var/syslog (default, configurable) for NetworkManager messages NetworkManager doesn't seem to notice permission or ownership changes on their own so touch the file to have it re-scanned in those cases.



                I had created a connection file with the incorrect line



                key-mgmt=wpa2-psk


                ...that value should have been simply "wpa-psk" and only the log file had been telling me where the problem was:




                Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: updating /etc/NetworkManager/system-connections/ATT2

                Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: error: invalid or missing connection property 'key-mgmt'







                share|improve this answer














                The NetworkManager.conf man page notes of the base config file plugin:




                For security, it will ignore files
                that are readable or writeable by any user or group other than root.




                In this case the result is "Unknown connection". chown your connection to root and chmod it 0600 to match those created by NetworkManager.



                More generally, connection files are very sensitive to spelling and nmcli a) will ignore a connection entirely if anything is wrong and b) won't tell you about typos in its normal output. However, see /var/syslog (default, configurable) for NetworkManager messages NetworkManager doesn't seem to notice permission or ownership changes on their own so touch the file to have it re-scanned in those cases.



                I had created a connection file with the incorrect line



                key-mgmt=wpa2-psk


                ...that value should have been simply "wpa-psk" and only the log file had been telling me where the problem was:




                Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: updating /etc/NetworkManager/system-connections/ATT2

                Sep 17 12:26:05 ahost NetworkManager[2477]: keyfile: error: invalid or missing connection property 'key-mgmt'








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 days ago

























                answered Aug 16 at 17:12









                gws

                114




                114



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f206468%2fmanual-creation-of-networkmanager-connection-file-fails-error-unknown-connecti%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)