ifconfig 命令详解
参数说明
-a 显示全部接口信息
[root@controller hello]# ifconfig -a
enp0s3: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 1500inet 192.168.10.202 netmask 255.255.255.0 broadcast 192.168.10.255inet6 fe80::a00:27ff:febc:4068 prefixlen 64 scopeid 0x20<link>ether 08:00:27:bc:40:68 txqueuelen 1000 (Ethernet)RX packets 132991 bytes 86829278 (82.8 MiB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 73175 bytes 13137262 (12.5 MiB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 192.168.56.102 netmask 255.255.255.0 broadcast 192.168.56.255inet6 fe80::a00:27ff:fe78:76c3 prefixlen 64 scopeid 0x20<link>ether 08:00:27:78:76:c3 txqueuelen 1000 (Ethernet)RX packets 15992 bytes 1550956 (1.4 MiB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 6044 bytes 1022821 (998.8 KiB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536inet 127.0.0.1 netmask 255.0.0.0inet6 ::1 prefixlen 128 scopeid 0x10<host>loop txqueuelen 1 (Local Loopback)RX packets 15273888 bytes 1929203265 (1.7 GiB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 15273888 bytes 1929203265 (1.7 GiB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
-s 显示摘要信息
[root@controller hello]# ifconfig -s
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
enp0s3 1500 133056 0 0 0 73204 0 0 0 BMPRU
enp0s8 1500 15995 0 0 0 6048 0 0 0 BMRU
lo 65536 15278612 0 0 0 15278612 0 0 0 LRU
启动或关闭指定网卡
ifconfig eth0 up
ifconfig eth0 down
ifup eth0
ifdown eth0
-promisc 设置是否支持网卡的promiscuous模式
如果选择此参数,网卡将接收网络中发给它所有的数据包
ifconfig eth0 promisc //设置
ifconfig eth0 -promisc //取消
-allmulti 设置是否支持多播模式
ifconfig eth0 allmulti //设置
ifconfig eth0 -allmulti //取消
如果选择此参数,网卡将接收网络中所有的多播数据包
配置IP地址
ifconfig eth0 192.168.120.56
ifconfig eth0 192.168.120.56 netmask 255.255.255.0
ifconfig eth0 192.168.120.56 netmask 255.255.255.0 broadcast 192.168.120.255
单网卡添加多个IP地址
ifconfig eth0:0 192.168.0.1 netmask 255.255.255.0 up
ifconfig eth0:1 192.168.0.2 netmask 255.255.255.0 up
删除IP地址
ifconfig eth0 del 192.168.227.188
启用或关闭arp协议
ifconfig eth0 arp
ifconfig eth0 -arp
设置最大传输单元
设置能通过的最大数据包大小为 1500 bytes
ifconfig eth0 mtu 1500
用ifconfig修改MAC地址
ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE
注意:使用ifconfig配置的网络信息,在网卡重启或者机器重启之后就失效了。如需永久保留,请在配置文件中持久化保存。
ifconfig 命令详解相关推荐
- linux ifconfig 命令详解
linux ifconfig 命令详解 功能说明:显示或设置网络设备. 语 法:ifconfig [网络设备][down up -allmulti -arp -promisc][add<地址&g ...
- linux中ifconfig命令作用,Linux下ifconfig命令详解
Linux下网卡命名规律:eth0,eth1.第一块以太网卡,第二块.lo为环回接口,它的IP地址固定为127.0.0.1,掩码8位.它代表你的机器本身.相关文件在/etc/sysconfig/net ...
- ifconfig命令详解,ifconfig命令输出说明
ifconfig 命令用于获取网卡配置与网络状态等信息. ifconfig命令输出说明: 第一部分的第一行显示网卡状态信息. eth0表示第一块网卡. UP代表网卡开启状态. RUNNING代表网卡的 ...
- 【Linux】ifconfig命令详解
Windows中的ipconfig命令行工具,被用来获取网络接口配置信息并对此进行修改.Linux系统拥有一个类似的工具,也就是 ifconfig (interfaces config).通常需要以r ...
- ifconfig命令详解
一直对执行完ifconfig命令后的显示结构有些朦胧,这次那就做个了解,嘻嘻~ ifconfig 配置网络或显示当前网络接口状态 1.命令格式 ifconfig [网络设备] [参数] 2.功能:用来 ...
- ifconfig 与 ip addr 命令详解 - 学习/实践
1.应用场景 主要用于了解学习,掌握使用IP地址相关知识, 如何查看IP信息,以及各个参数代表的含义 2.学习/操作 1.文档阅读 网络协议概论 | Laravel 学院 - 不定期分享之 ifcon ...
- nmcli命令详解_【高新课堂】第一百二十五期Liunx必备命令
点击上方"蓝字"关注我们吧! Liunx系统启动默认为字符界面,一般不会启用图像界面,所以对命令行的熟练程度能更加高效.便捷的管理Liunx服务器. 这节课向读者介绍Liunx系统 ...
- Fedora 中的 Yum 命令详解
http://pengjiayou.com/blog/yum-fedora-in-order-detailed-explanation 总所周知,Redhat和Fedora的软 件安装命令是rpm,但 ...
- yum命令 启用仓库_yum 命令详解-yum仓库配置文件详解
yum安装的优点 1.必须得有网络,通过网络获取软件. 2.管理rpm包 3.自动解决依耐 4.命令简单好用 5.生产最佳实践 yum命令详解 # linux安装软件的三种方式 1.rpm安装 2.源 ...
最新文章
- 2017年云栖大会-云HBase专场会后资料-欢迎扩散
- golang goland报错错误 $GOPATH/go.mod exists but should not 解决方法
- 数据访问层设计(持久层架构设计)
- sql server image字段的转换
- 中国电磁线行业供需状况与十四五竞争态势研究报告2022版
- 操作系统(三十)避免死锁
- cytoscape操作经验
- [技术分享] 融云开发案例核心代码分享
- ×××的虚拟专用网--gre
- python叮当猫代码_详细介绍一个利用html+css实现叮当猫的实例代码
- 果园机器人的写作思路_《果园机器人》三年级教学设计
- 387.字符串中的第一个唯一字符
- linux系统视屏录像_在Linux上的点击,弹出和故障排除录像
- QSIP驱动W25Q256调试记录
- 前端-JS基础之数据类型
- java获取response_java response响应设置 java怎么获取response
- 黑与白的融合,手把手带大家画一只大熊猫
- 网友对spring.net的理解:(为什么要用晦涩难懂的spring?)
- 设计中的确定性与不确定性思考
- mongodb用哪些端口号_mongodb端口号(mongodb默认端口号)