Thursday, December 19, 2013

Workaround for Wired Network Connection Switching with nmcli - Gnome 3.10 Fedora 20


Fedora 20 is released on 17th December 2013. It was shipped with Gnome 3.10. There is a issue with Gnome 3.10 by design. There is no Wired Network Control from Network Manager applet. (GNOME Bugzilla – Bug 708966)




As you can see, Wi-Fi control is there. But no Wired Network control.

With network  connections editor you can create Network Connection profile. But you have to use Network Manager CLI (nmcli) to connect the network. Here is how to use nmcli for it. Root access will not be required.



I have just have two Network Connections. It is visible to both Network Connections and "nmcli connection".

[kasun@localhost ~]$ nmcli connection
NAME               UUID                                  TYPE             TIMESTAMP-REAL                  
DHCP               8bc343a0-2916-4f7d-a590-d61f98e5413c  802-3-ethernet   Thu 19 Dec 2013 12:12:36 AM IST 
Office 4G Network  28b03045-6877-48d8-88be-2b3a692d2913  802-11-wireless  Wed 18 Dec 2013 07:56:39 PM IST

[kasun@localhost ~]$ ifconfig
lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 23753  bytes 30311854 (28.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 23753  bytes 30311854 (28.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

p5p1: flags=4163  mtu 1500
        inet 192.168.10.20  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::ca0a:a9ff:fead:593a  prefixlen 64  scopeid 0x20
        ether c8:0a:a9:aa:bb:cc  txqueuelen 1000  (Ethernet)
        RX packets 205603  bytes 204316900 (194.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 178792  bytes 23101120 (22.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 13  collisions 0

[kasun@localhost ~]$ 

Now I just add new network connection profile with Network Connections GUI with name of "Sugar Cube" with different IP address. Now it is visible to nmcli.

[kasun@localhost ~]$ nmcli connection
NAME               UUID                                  TYPE             TIMESTAMP-REAL                  
DHCP               8bc343a0-2916-4f7d-a590-d61f98e5413c  802-3-ethernet   Thu 19 Dec 2013 12:12:36 AM IST 
Office 4G Network  28b03045-6877-48d8-88be-2b3a692d2913  802-11-wireless  Wed 18 Dec 2013 07:56:39 PM IST 
Sugar Cube         167a92d9-5995-40f2-8c0b-801a1adabb96  802-3-ethernet   never                           
[kasun@localhost ~]$ 

However it is not connected yet. You can see it with "nmcli connection show active"

[kasun@localhost ~]$ nmcli connection show active
NAME  UUID                                  DEVICES  DEFAULT  VPN  MASTER-PATH 
DHCP  8bc343a0-2916-4f7d-a590-d61f98e5413c  p5p1     yes      no   --          
[kasun@localhost ~]$

Now we use the 'nmcli connection up "Sugar Cube"' to active it.

[kasun@localhost ~]$ nmcli connection up "Sugar Cube"
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)
[kasun@localhost ~]$

If you check the active connection now, you can our new profile is active now.

[kasun@localhost ~]$ nmcli connection show active
NAME        UUID                                  DEVICES  DEFAULT  VPN  MASTER-PATH 
Sugar Cube  167a92d9-5995-40f2-8c0b-801a1adabb96  p5p1     yes      no   --          
[kasun@localhost ~]$ 

[kasun@localhost ~]$ ifconfig
lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 23876  bytes 30319904 (28.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 23876  bytes 30319904 (28.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

p5p1: flags=4163  mtu 1500
        inet 192.168.10.50  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::ca0a:a9ff:fead:593a  prefixlen 64  scopeid 0x20
        ether c8:0a:a9:aa:bb:cc  txqueuelen 1000  (Ethernet)
        RX packets 206810  bytes 204996124 (195.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 180010  bytes 23295948 (22.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 13  collisions 0

[kasun@localhost ~]$ 

This can be used to switch between wired network profiles until a shell extension or update arrives.

No comments: