Differences

This shows you the differences between two versions of the page.


ifconfig [2016/04/27 20:08] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== 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'')
 +  * **<interface>** - display details of interface
 +  * **<interface> up** - activate an interface
 +  * **<interface> down** - deactivate an interface
 +  * **<interface> <address>** - set the IP address to this value
 +  * **<interface> broadcast <address>** - set the protocol broadcast address
 +  * **<interface> netmask <address>** - set the IP network mask
 +  * **<interface> hw <class> <address>** - 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.
 +
 +<code>
 +ifconfig
 +</code>
 +
 +** Bring an interface online **
 +
 +<code>
 +ifconfig eth0 up
 +</code>
 +
 +** Display information about the interface **
 +
 +<code>
 +ifconfig eth0
 +</code>
 +
 +** Set the IP address of an interface **
 +
 +<code>
 +ifconfig eth0 192.168.1.1
 +</code>
 +
 +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 **
 +
 +<code>
 +ifconfig eth0 0.0.0.0
 +</code>
 +
 +You can run ''ifconfig eth0 0'' as well.
 +
 +** Set the IP address and broadcast of an interface **
 +
 +<code>
 +ifconfig eth0 192.168.1.1 broadcast 192.168.1.255
 +</code>
 +
 +** Set the IP address, broadcast and netmask of an interface **
 +
 +<code>
 +ifconfig eth0 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0
 +</code> 
 +
 +** Set the MAC address of an interface **
 +
 +<code>
 +ifconfig eth0 hw ether 00:16:3E:24:13:59
 +</code>
  

Navigation
QR Code
QR Code ifconfig (generated for current page)