在CentOS 7最小化服務器版本中啟用并使用“ifconfig”命令?

如果你不知道在哪里可以找到ifconfig命令,請按照以下簡單的步驟來找到它。首先,讓我們找出哪個包提供了ifconfig命令。要完成這項任務,輸入以下命令:

yum provides ifconfig

輸出樣例:

Loadedplugins:fastestmirror

Loadingmirror speedsfromcached hostfile

*base:centos.aol.in

*extras:centos.aol.in

*updates:centos.aol.in

net-tools-2.0-0.17.20131004git.el7.x86_64:Basicnetworking tools

Repo:@base

Matchedfrom:

Filename:/usr/sbin/ifconfig

或者你也可以使用以下命令。

yum whatprovides ifconfig

這里,“provides”或者“whatprovides”開關用于找出某個包提供了某些功能或文件。

就像你在上面的輸出中所看到的,net-tools包提供了ifconfig命令。因此,讓我們安裝net-tools包來使用ifconfig命令。

yum install net-tools

現在,你就可以像以往一樣使用ifconfig命令了。

ifconfig-a

輸出樣例:

lo:flags=73mtu16436

inet127.0.0.1netmask255.0.0.0

inet6::1prefixlen128scopeid0x10

loop txqueuelen0(LocalLoopback)

RX packets0bytes0(0.0B)

RX errors0dropped0overruns0frame0

TX packets0bytes0(0.0B)

TX errors0dropped0overruns0carrier0collisions0

venet0:flags=211mtu1500

inet127.0.0.1netmask255.255.255.255broadcast0.0.0.0destination127.0.0.1

unspec00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00txqueuelen0(UNSPEC)

RX packets7073bytes8549159(8.1MiB)

RX errors0dropped0overruns0frame0

TX packets4611bytes359201(350.7KiB)

TX errors0dropped0overruns0carrier0collisions0

venet0:0:flags=211mtu1500

inet192.168.1.101netmask255.255.255.255broadcast192.168.1.101destination192.168.1.101

unspec00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00txqueuelen0(UNSPEC)

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容