====== ifconfig ====== * [[Networking]] * [[ifenslave]] * [[ifup]] * [[ip]] * [[route]] Syntax: * ''ifconfig [-v] [-a] [-s] interface'' * ''ifconfig [-v] interface [aftype] options | address ...'' Options: * **-a** - display all interfaces that are available, even if down * **-s [interface]** - display a short list (similar to ''netstat -i'') * **** - display details of interface * ** up** - activate an interface * ** down** - deactivate an interface * **
** - set the IP address to this value * ** broadcast
** - set the protocol broadcast address * ** netmask
** - set the IP network mask * ** hw
** - set the hardware address ** Display all interfaces that are active ** This does not necessarily mean that an interface has any addresses attached to it. Only that it is available and able to set something. ifconfig ** Bring an interface online ** ifconfig eth0 up ** Display information about the interface ** ifconfig eth0 ** Set the IP address of an interface ** ifconfig eth0 192.168.1.1 Note that if you don't set a broadcast or netmask address when setting the ip (fex: ''ifconfig eth0 192.168.1.1''), then ''ifconfig'' will set them to the default values. Broadcast would be ''192.168.1.255'' and netmask would be ''255.255.255.0''. ** Remove the IP address of an interface ** ifconfig eth0 0.0.0.0 You can run ''ifconfig eth0 0'' as well. ** Set the IP address and broadcast of an interface ** ifconfig eth0 192.168.1.1 broadcast 192.168.1.255 ** Set the IP address, broadcast and netmask of an interface ** ifconfig eth0 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0 ** Set the MAC address of an interface ** ifconfig eth0 hw ether 00:16:3E:24:13:59