Linux viewing network card UUID

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.