[Networkmanager] Network Manager connection profile creation fails when /etc/NetworkManager/system-connections is a symbolically linked.
Greg Oliver
oliver.greg at gmail.com
Wed Aug 2 15:06:13 UTC 2023
On Wed, Aug 2, 2023 at 10:05 AM Greg Oliver <oliver.greg at gmail.com> wrote:
> On Wed, Aug 2, 2023 at 1:54 AM manjunatha srinivasan <
> manjunathan.n at gmail.com> wrote:
>
>> Hi
>>
>> Network Manager doesn't allow creation of any network connection profile
>> for interface using symbolic link instead of folder. I am in need of having
>> /etc/NetworkManager/system-connections as symbolic link to
>> /tmp/system-connections. Please let me know any solution for this and also
>> let me know the more root cause of this error.
>>
>> root at test:/etc# ls -lt /etc/NetworkManager/
>> total 20
>> lrwxrwxrwx 1 root root 32 Aug 1 17:15 system-connections ->
>> /tmp/system-connections/
>> drwxr-xr-x 5 root root 4096 Aug 1 16:33 dispatcher.d
>> -rw-r-xr-x 1 root root 148 Mar 7 2022 NetworkManager.conf
>> drwxr-xr-x 2 root root 4096 Mar 7 2022 conf.d
>> drwxr-xr-x 2 root root 4096 Mar 7 2022 dnsmasq-shared.d
>> drwxr-xr-x 2 root root 4096 Mar 7 2022 dnsmasq.d
>> root at fxr90:/etc# ls -lt /etc/NetworkManager/system-connections
>> lrwxrwxrwx 1 root root 32 Aug 1 17:15
>> /etc/NetworkManager/system-connections -> /tmp/system-connections/
>> root at test:/etc# nmcli con add con-name my-eth0 type ethernet ifname
>> eth0 ipv4.method auto ipv6.method auto connection.autoconnect-priority 1
>> ipv4.dhcp-timeout 10 ipv6.ra-timeout 10
>> Error: Failed to add 'my-eth0' connection: failure adding connection:
>> settings plugin does not support adding connections
>>
>> Thanks
>> Manjunatha Srinivasan N
>>
>
> Possibly selinux -
>
> ls -lZ /tmp/system-connections
>
> should be:
> system_u:object_r:NetworkManager_etc_rw_t:s0
>
> You may need to relabel the symlink - I do this often to overcome selinux
> after symlinking:
>
> semanage fcontext -a -t NetworkManager_etc_rw_t
> "/tmp/system-connections(/.*)?"
> restorecon -Rv /tmp/system-connections
>
> Since /tmp is volatile, you will more than likely need to provide a way to
> do this @ each boot (if this is even the problem).. I have not tried your
> approach. I just know selinux and symlinks require a little finesse.
>
> Also, you can always try "setenforce 0" and restart NetworkManager. If
> that works, you will know it is selinux.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/networkmanager/attachments/20230802/5b730c8d/attachment-0001.htm>
More information about the Networkmanager
mailing list