[linux] 查看网卡UUID
virtualbox复制了虚拟机,重新初始化网卡后,需要对/etc/sysconfig/network-scripts/ifcfg-eth0更新UUID值,虽然不改暂时也没发现有问题。
网上查找需要nmcli工具进行查看。
1.首先我们查看一下nmcli是哪个软件包提供的
mportant; border-radius: 0px !important; background: none !important; bottom: auto !important; float: none !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(175, 175, 175) !important;" width="35" height="NaN"> 1 2 3 4 5 6 7 8 9 10 | [root@localhost ~] # yum provides "*/nmcli" Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.com 1:NetworkManager-0.8.1-113.el6.x86_64 : Network connection manager and user applications Repo : base Matched from: Filename : /usr/bin/nmcli |
2.安装NetworkManager服务
1 | [root@localhost ~] # yum -y install NetworkManager |
启动NetworkManager服务
1 | [root@localhost ~] # /etc/init.d/NetworkManager start |
运行nmcli发现有报错
1 2 | [root@localhost ~] # nmcli con Error: could not connect to D-Bus. |
查看/var/log/messages日志
1 2 3 4 5 6 | [root@localhost ~] # more /var/log/messages ... Apr 20 14:53:05 localhost NetworkManager[2013]: <info> NetworkManager (version 0.8.1-113.el6) is starting... Apr 20 14:53:05 localhost NetworkManager[2013]: <info> Read config file /etc/NetworkManager/NetworkManager .conf Apr 20 14:53:05 localhost NetworkManager[2013]: <error> [1492671185.606620] [nm-dbus-manager.c:278] nm_dbus_manager_init_bus(): Could not get the system bus. Make sure the message bus daemon is running! Message: Failed to connect to socket /var/run/dbus/system_bus_socket : Connection refused ... |
3.需要先启动messagebus,再启动NetworkManager
1 2 3 4 5 | [root@localhost ~] # /etc/init.d/messagebus start Starting system message bus: [ OK ] [root@localhost ~] # /etc/init.d/NetworkManager start Setting network parameters... [ OK ] Starting NetworkManager daemon: [ OK ] |
4.此时再运行nmcli即可查看网卡UUID
1 2 3 4 | [root@localhost ~] # nmcli con NAME UUID TYPE SCOPE TIMESTAMP-REAL System eth0 bbc0e340-6979-4e10-8b98-f1d395e7304e 802-3-ethernet system Thu 20 Apr 2017 02:54:51 PM CST NAME UUID TYPE SCOPE TIMESTAMP-REAL |
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/685.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~