ifconfig 是 Linux 中査看和临时修改 IP 地址的命令。
命令名称:ifconfig。
英文原意:configure a network interface。
所在路径:/sbin/ifconfig。
执行权限:超级用户。
功能描述:配置网络接口。
[root@VM_0_10_centos test]# ifconfig
#eth0网卡信息 网络类型为以太网 MAC地址
eth0 Link encap:Ethernet HWaddr 52:54:00:29:E4:B7
#IP地址 广播地址 子网掩码
inet addr:172.16.0.10 Bcast:172.16.15.255 Mask:255.255.240.0
#网络参数 最大传输单元数据包转送次数
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
#接收到的数据包惰况
RX packets:14853856 errors:0 dropped:0 overruns:0 frame:0
#发送的数据包情况
TX packets:15438824 errors:0 dropped:0 overruns:0 carrier:0
#数据包碰撞 数据缓冲区长度
collisions:0 txqueuelen:1000
#IRQ中街 内存地址
RX bytes:2078165852 (1.9 GiB) TX bytes:3403620546 (3.1 GiB)
#本地回环网卡信息
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:738495 errors:0 dropped:0 overruns:0 frame:0
TX packets:738495 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:541710179 (516.6 MiB) TX bytes:541710179 (516.6 MiB)
[root@VM_0_10_centos test]#ifconfig eth0 192.168.1.1
#配置IP地址,不指定子网掩码就会使用标准子网掩码
[root@VM_0_10_centos test]#ifconfig eth0 192.168.44.3 netmask 255.255.255.0
#配置IP地址,同时配置子网掩码