linux命令精选 – ifconfig
ifconfig [interface] [address [parameters]]
ifconfig 命令用于查看和设置网口接口参数,包括IP地址,子网掩码以及硬件地址等等。
使用范例:
ifconfig eth0
查看接口eth0的参数
ifconfig -a
查看所有接口的参数
ifconfig eth0 down
停用eth0接口
ifconfig eth0 up
启动eth0接口
ifconfig eth0 192.168.1.102 netmask 255.255.255.0
设置eth0的网络地址为192.168.1.102,子网掩码255.255.255.0
ifconfig eth0 hw ether 00:11:22:33:44:55
设置接口eth0的硬件地址为00:11:22:33:44:55
ifconfig eth0 promisc
设置混杂模式
ifconfig eth0 -promisc
取消混杂模式
