5

I have a clean installation of Ubuntu 12.04 Server. I would like to find the UUID for a network connection. How do I find this?

ifconfig -a does not list it:

eth0      Link encap:Ethernet  HWaddr 00:1e:67:6a:78:a8  
          inet addr:192.168.50.18  Bcast:192.168.50.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:67ff:fe6a:78a8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:572287 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70324 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:222908307 (222.9 MB)  TX bytes:7982096 (7.9 MB)
          Interrupt:16 Memory:c2300000-c2320000 

nmcli is not installed (because this is Ubuntu server):

user@server# nmcli
The program 'nmcli' is currently not installed.  You can install it by typing:
apt-get install network-manager

From a desktop install, I can do:

user@desktop# nmcli c list
NAME                      UUID                                   TYPE              TIMESTAMP-REAL                    
Wired connection 2        d00a6778-80d6-4812-ad54-041de24e47fe   802-3-ethernet    Mon 16 Dec 2013 12:20:09 EST      
Wired connection 1        4fb95570-1922-495a-b498-846b7a6b0655   802-3-ethernet    Tue 17 Dec 2013 11:20:03 EST      
miwifi                    f3182ff5-81c2-44c4-9c4b-d3a1f0a550e9   802-11-wireless   never   

How do I find it when network-manager isn't installed? Surely I don't have to install network-manager?

2
  • 1
    uuid for what? In linux, network connections don't have uuid. Its possible dbus assigns a uuid to a network connection in ubuntu. Is this what you mean? Feb 24, 2013 at 0:49
  • Apologies for the delay. I have added extra info from a desktop machine. It's possible that the UUID is created by Network-Manager which would be frustrating. I also saw UUIDs being used for network connections in OpenStack Quantum and thought it might be lower-level, but perhaps they're both implementing their own UUIDs for the connections. Dec 17, 2013 at 0:30

3 Answers 3

4

The UUID is part of Network Manager. If you don't have Network Manager installed and enabled, then you don't have this UUID.

It is not related to OpenStack Quantum UUID at all.

Therefore, you cannot find the UUID. It does not exist.

2

The UUID is generated with a tool from the util-linux package: uuidgen, this generates random numbers. uuidgen is also used to generate UUID's for partitions at their creation and invoked by tune2fs when you request it to create a new UUID for a partition.

Expect several tools to identify a device as new when you change the UUID in configuration files.

2

The UUID for network card is a runtime thing, done by NetworkManager. The closest you can get to find your network card in "/dev" is actually to look into "/proc" instead, where you can see there is no UUID mentioned anywhere:

[root@kubeadm-test ~]# ls -l /sys/class/net/
total 0
lrwxrwxrwx. 1 root root 0 Jan 22 08:35 enp1s0 -> ../../devices/pci0000:00/0000:00:02.0/0000:01:00.0/virtio0/net/enp1s0
lrwxrwxrwx. 1 root root 0 Jan 22 08:35 lo -> ../../devices/virtual/net/lo
[root@kubeadm-test ~]# 


[root@kubeadm-test ~]# nmcli connection
NAME    UUID                                  TYPE      DEVICE 
enp1s0  7be41c51-becf-3963-bd4f-1562dd489fb3  ethernet  enp1s0 
[root@kubeadm-test ~]# 

The "nmcli conn show enp1s0" command shows UUID and not the HW address.

[root@kubeadm-test ~]# nmcli conn show enp1s0
connection.id:                          enp1s0
connection.uuid:                        7be41c51-becf-3963-bd4f-1562dd489fb3
connection.stable-id:                   --
connection.type:                        802-3-ethernet
connection.interface-name:              enp1s0
connection.autoconnect:                 yes
connection.autoconnect-priority:        -999
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1611301844
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.wait-device-timeout:         -1
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0
802-3-ethernet.duplex:                  --
802-3-ethernet.auto-negotiate:          no
802-3-ethernet.mac-address:             --
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --
802-3-ethernet.mtu:                     auto
802-3-ethernet.s390-subchannels:        --

The "nmcli device show enp1s0" command shows HWADDR and not the UUID.

[root@kubeadm-test ~]# nmcli device show enp1s0
GENERAL.DEVICE:                         enp1s0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         52:54:00:58:A4:20
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     enp1s0
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.122.217/24
IP4.GATEWAY:                            192.168.122.1
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 192.168.122.1, mt = 100
IP4.ROUTE[2]:                           dst = 192.168.122.0/24, nh = 0.0.0.0, mt = 100
IP4.DNS[1]:                             192.168.122.1
IP6.ADDRESS[1]:                         fe80::5054:ff:fe58:a420/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255
[root@kubeadm-test ~]# 

You must log in to answer this question.

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