新聞中心
許多windows非常熟悉ipconfig命令行工具,它被用來獲取網(wǎng)絡(luò)接口配置信息并對(duì)此進(jìn)行修改。Linux系統(tǒng)擁有一個(gè)類似的工具,也就是ifconfig(interfaces config)。通常需要以root身份登錄或使用sudo以便在Linux機(jī)器上使用ifconfig工具。

在平利等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站 網(wǎng)站設(shè)計(jì)制作按需網(wǎng)站設(shè)計(jì),公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站制作,營(yíng)銷型網(wǎng)站,外貿(mào)營(yíng)銷網(wǎng)站建設(shè),平利網(wǎng)站建設(shè)費(fèi)用合理。
CentOS 7版系統(tǒng)查看網(wǎng)絡(luò)信息的命令
CentOS 7最小化系統(tǒng),使用“ip addr”和“ip link”命令來查找網(wǎng)卡詳情。要知道統(tǒng)計(jì)數(shù)據(jù),可以使用“ip -s link”。
要查看網(wǎng)卡細(xì)節(jié):ip addr
[root@linuxprobe ~]#ip addr
1: 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
要查看網(wǎng)絡(luò)接口統(tǒng)計(jì)數(shù)據(jù):ip link
[root@linuxprobe ~]#ip link
1: 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 link
1: 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
在CentOS 7最小化服務(wù)器版本中啟用“ifconfig”命令
如果你不知道在哪里可以找到ifconfig命令,請(qǐng)按照以下簡(jiǎn)單的步驟來找到它。
首先,讓我們找出哪個(gè)包提供了ifconfig命令:
[root@linuxprobe ~]# yum provides ifconfig
Loaded 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”開關(guān)用于找出某個(gè)包提供了某些功能或文件。
net-tools包提供了ifconfig命令。因此,安裝net-tools包也可以使用ifconfig命令。
安裝net-tools包
yum install net-tools
現(xiàn)在,你就可以像以往一樣使用ifconfig命令了。
[root@linuxprobe ~]# ifconfig -a
lo: 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)
當(dāng)前標(biāo)題:CentOS7mini使用ifconfig實(shí)例
網(wǎng)站地址:http://www.dlmjj.cn/article/dhpddod.html


咨詢
建站咨詢
