linux查看ip地址命令 ifconfig不行(ifconfig配置静态ip命令)
linux查看ip地址命令 ifconfig不行,原文标题:Linux设置和查看静态IP之ifconfig命令。请关注本头条号,每天坚持更新原创干货技术文章。如需
linux查看ip地址命令 ifconfig不行,原文标题:Linux设置和查看静态IP之ifconfig命令。
请关注本头条号,每天坚持更新原创干货技术文章。
如需学习视频,请在微信搜索公众号“智传网优”直接开始自助视频学习
1. ifconfig命令简介
linux系统中使用ifconfig命令查看和修改IP信息。但新系统建议使用ip命令。
CentOS 7 开始,已经废弃了ifconfig命令,ifconfig命令由net-tools套件提供。
CentOS 7默认并没有安装这个套件,需要手动额外安装。
[root@zcwyou ~]# yum -y install net-tools

总下载量:306 k
安装大小:918 k
Downloading packages:
net-tools-2.0-0.24.20131004git.el7.x86_64.rpm | 306 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : net-tools-2.0-0.24.20131004git.el7.x86_64 1/1
验证中 : net-tools-2.0-0.24.20131004git.el7.x86_64 1/1
已安装:
net-tools.x86_64 0:2.0-0.24.20131004git.el7
完毕!

linux安装ifconfig命令
2. 查看网卡信息,包括IP信息以及入口流量信息和出口流量信息
[root@zcwyou ~]# ifconfig
ens160: flags=4163 mtu 1500
inet 113.105.164.151 netmask 255.255.255.192 broadcast 113.105.164.191
inet6 fe80::4e97:36a0:c406:6ac1 prefixlen 64 scopeid 0x20
ether 00:0c:29:dc:f4:8f txqueuelen 1000 (Ethernet)
RX packets 143511935 bytes 146703282343 (136.6 GiB)
RX errors 0 dropped 779125 overruns 0 frame 0
TX packets 92937512 bytes 141760328247 (132.0 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 52922204 bytes 139829819707 (130.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 52922204 bytes 139829819707 (130.2 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

linux使用ifconfig查看网卡与IP地址信息
3. 禁用和启动网卡
[root@zcwyou ~]# ifconfig eth0 down[root@zcwyou ~]# ifconfig eth0 up
或者:
[root@zcwyou ~]# ifdown ens33 && ifup ens33

linux禁用和重新启动网卡
4. 配置网卡的IP地址与广播地址
[root@zcwyou ~]# ifconfig eth0 172.16.26.88 netmask 255.255.255.0 broadcast 172.16.26.255
5. 修改mtu大小
[root@zcwyou ~]# ifconfig eth0 mtu 1500
6. 总结
ifdown命令是net-tools套件之一,但目前已经不建议使用net-tools套件了,因为已经有了iproute2这个现代的网络管理工具。CentOS7开始,默认已经不再集成net-tools,而是集成了iproute2。
本文已同步至博客站,尊重原创,转载时请在正文中附带以下链接:
https://www.linuxrumen.com/cyml/272.html
点击了解更多,快速查看更多的技术文章列表。
本文《linux查看ip地址命令 ifconfig不行(ifconfig配置静态ip命令)》由网赚联盟( wangzhuan.org.cn )整理或原创,感谢您的阅读。随机文章
SEO教程友情链接交换
搜素引擎算法
关键词排名优化
网站内容优化
GEO培训
SEO小小课堂网
SEO教程
百度搜索“网赚联盟”即可找到本站,微信搜索“小小课堂网”关注小小课堂网公众号。网赚联盟( wangzhuan.org.cn )欢迎用户投稿,发布者:Linux学习教程,文章版权归作者所有,投稿文章不代表网赚联盟立场,中二少年发布为网赚联盟原创文章,转载请注明出处:https://wangzhuan.org.cn/849179.html

微信扫一扫
支付宝扫一扫