ifconfig
ifconfig是Linux中用于显示或配置网络设备(网卡)的命令,配置网卡的IP地址语法例:ifconfig eth0 192.168.9.1 network 255.255.255.0
启动关闭制定网卡
#ifconfig eth0 down
ifconfig eth0 up
用ifconfig修改MAC地址
# ifconfig eth0 down //关闭网卡
ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE //修改MAC地址
ifconfig eth0 up //启动网卡
ifconfig eth1 hw ether 00:1D:1C:1D:1E //关闭网卡并修改 MAC地址
ifconfig eth1 up //启动网卡
修改IP地址
ifconfig eth0 192.168.1.56
//给eth0网卡配置IP地址
ifconfig eth0 192.168.1.56 netmask 255.255.255.0
// 给eth0网卡配置IP地址,并加上子掩码
ifconfig eth0 192.168.1.56 netmask 255.255.255.0 broadcast 192.168.1.255
// 给eth0网卡配置IP地址,加上子掩码,加上个广播地址
启动或关闭ARP协议
ifconfig eth0 arp //开启
ifconfig eth0 -arp //关闭