⑴实例:配置IP地址
⑵[rootlocalhost ~]# ifconfig eth ...
⑶[rootlocalhost ~]# ifconfig eth ... mask ...
⑷[rootlocalhost ~]# ifconfig eth ... mask ... broadcast ...
⑸ifconfig eth ...
⑹给eth网卡配置IP地:...
⑺ifconfig eth ... mask ...
⑻给eth网卡配置IP地址:... ,并加上子掩码:...
⑼ifconfig eth ... mask ... broadcast ...
⑽给eth网卡配置IP地址:...,加上子掩码:...,加上个广播地址: ...
⑾实例:启用和关闭ARP协议
⑿ifconfig eth arp
⒀ifconfig eth -arp
⒁[rootlocalhost ~]# ifconfig eth arp
⒂[rootlocalhost ~]# ifconfig eth -arp
⒃ifconfig eth arp 开启网卡eth 的arp协议;
⒄ifconfig eth -arp 关闭网卡eth 的arp协议;
⒅实例:设置最大传输单元
⒆命令:ifconfig eth mtu
⒇[rootlocalhost ~]# ifconfig eth mtu
⒈[rootlocalhost ~]# ifconfig
⒉eth Link encap:Ether HWaddr :::BF::F
⒊i addr:... Bcast:... Mask:...
⒋UP BROADCAST RUNNING MULTICAST MTU: Metric:
⒌RX packets: errors: dropped: overruns: frame:
⒍TX packets: errors: dropped: overruns: carrier:
⒎collisions: txqueuelen:
⒏RX bytes: (. MiB TX bytes: (. MiB《/p》 《p》lo Link encap:Local Loopback
⒐i addr:... Mask:...
⒑UP LOOPBACK RUNNING MTU: Metric:
⒒RX packets: errors: dropped: overruns: frame:
⒓TX packets: errors: dropped: overruns: carrier:
⒔collisions: txqueuelen:
⒕RX bytes: (. KiB TX bytes: (. KiB《/p》 《p》[rootlocalhost ~]# ifconfig eth mtu
⒖[rootlocalhost ~]# ifconfig
⒗eth Link encap:Ether HWaddr :::BF::F
⒘i addr:... Bcast:... Mask:...
⒙UP BROADCAST RUNNING MULTICAST MTU: Metric:
⒚RX packets: errors: dropped: overruns: frame:
⒛TX packets: errors: dropped: overruns: carrier:
①collisions: txqueuelen:
②RX bytes: (. MiB TX bytes: (. MiB《/p》 《p》lo Link encap:Local Loopback
③i addr:... Mask:...
④UP LOOPBACK RUNNING MTU: Metric:
⑤RX packets: errors: dropped: overruns: frame:
⑥TX packets: errors: dropped: overruns: carrier:
⑦collisions: txqueuelen:
⑧RX bytes: (. KiB TX bytes: (. KiB《/p》 《p》[rootlocalhost ~]#
⑨设置能通过的最大数据包大小为 bytes
⑩备注:用ifconfig命令配置的网卡信息,在网卡重启后机器重启后,配置就不存在。要想将上述的配置信息永远的存的电脑里,那就要修改网卡的配置文件了。
Ⅰ上面就是Linux系统下ifconfig命令的用法介绍了,从文中我们可以知道,使用ifconfig命令可配置ip地址、显示网络设备信息、启动关闭指定网卡等,在设置网卡的时候会使用到该命令。