Sometimes we accidentally delete or corrupt the/etc/sysconfig/network-scripts/ifcfg-eth0 (which can be viewed via this file) and do not know what the network card UUID is when you re-edit the Ifcfg-eth0 file ( Of course you can not write), then we have a way to see the network card UUID? The method we use here is to use the NMCLI command to view it as follows:
1, first we look at the NMCLI is which package provides
[email protected] ~]# Yum provides "*/NMCLI"
Loaded Plugins:fastestmirror, security
Loading mirror speeds from cached hostfile
* base:mirrors.cug.edu.cn
* extras:mirrors.cug.edu.cn
* updates:CentOS.ustc.edu.cn
1:networkmanager-0.8.1-75.el6.i686:network Connection Manager and
: User Applications
Repo:base
Matched from:
Filename:/USR/BIN/NMCLI
2, from the above results can be seen nmcli, next we install NetworkManager this package
[Email protected] ~]# yum-y install NetworkManager
3. Start NetworkManager Service
[[Email protected] ~]# service NetworkManager start
Setting Network Parameters ... [OK]
Starting NetworkManager daemon: [OK]
4. Check the network card UUID
[[email protected] ~]# Nmcli con | Sed-n ' 1,2p '
NAME UUID TYPE SCOPE timestamp-real
System eth0 C1021d28-7238-4f26-8e92-4aea5d607cab 802-3-ethernet system Mon Dec 12:49:14 PM CST
5, check whether the same as the/etc/sysconfig/network-scripts/ifcfg-eth0 inside the UUID value (note: The test is only valid when the Ifcfg-eth0 file can see the UUID properly)
[Email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0 | grep UUID
Uuid=c1021d28-7238-4f26-8e92-4aea5d607cab
Linux viewing network card UUID