这篇文章主要介绍“CentOS7中mini使用ifconfig的方法是什么”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“CentOS7中mini使用ifconfig的方法是什么”文章能帮助大家解决问题。
CentOS 7最小化系统,使用“ip addr”和“ip link”命令来查找网卡详情。要知道统计数据,可以使用“ip -s link”。
[root@linuxprobe ~]#ip addr1: lo: mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: venet0: mtu 1500 qdisc noqueue state UNKNOWN
link/void
inet 127.0.0.1/32 scope host venet0
inet 192.168.1.101/32 brd 192.168.1.101 scope global venet0:0
[root@linuxprobe ~]#ip link1: lo: mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: venet0: mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT
link/void
或者使用:ip -s link
[root@linuxprobe ~]#ip -s link1: lo: mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
2: venet0: mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT
link/void
RX: bytes packets errors dropped overrun mcast
8515667 6667 0 0 0 0
TX: bytes packets errors dropped carrier collsns
300403 4249 0 0 0 0
如果你不知道在哪里可以找到ifconfig命令,请按照以下简单的步骤来找到它。
[root@linuxprobe ~]# yum provides ifconfigLoaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.aol.in
* extras: centos.aol.in
* updates: centos.aol.in
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo : @base
Matched from:
Filename : /usr/sbin/ifconfig
或者你也可以使用以下命令
yum whatprovides ifconfig
这里,“provides”或者“whatprovides”开关用于找出某个包提供了某些功能或文件。
net-tools包提供了ifconfig命令。因此,安装net-tools包也可以使用ifconfig命令。
yum install net-tools
现在,你就可以像以往一样使用ifconfig命令了。
[root@linuxprobe ~]# ifconfig -alo: flags=73 mtu 16436
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
venet0: flags=211 mtu 1500
inet 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0 destination 127.0.0.1
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
RX packets 7073 bytes 8549159 (8.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4611 bytes 359201 (350.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
venet0:0: flags=211 mtu 1500
inet 192.168.1.101 netmask 255.255.255.255 broadcast 192.168.1.101 destination 192.168.1.101
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
关于“CentOS7中mini使用ifconfig的方法是什么”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注亿速云行业资讯频道,小编每天都会为大家更新不同的知识点。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。