Posted On 2007-05-01 by FortyPoundHead
Keywords: Command Reference
Tags: Linux Commandline Glossary General Linux
Views: 1611

Stand for InterFace CONFIGurator - display your ip address, network interfaces, transferred and received data information, configure a network interface.


ifconfig [interface]
ifconfig interface [aftype] options | address ...


Switch/Option/Setting Explanation
interfaceThe name of the interface. Usually a driver name followed by a unit number, eth0 = 1st Ethernet interface.
upThis flag causes the interface to be activated. It is implicitly specified if an address is assigned to the interface.
downThis flag causes the driver for this interface to be shut down.
[-]arpEnable or disable the use of the ARP protocol on this interface.
[-]promiscEnable or disable the promiscuous mode of the interface. If selected, all packets on the network will be received by the interface.
[-]allmultiEnable or disable all-multicast mode. If selected, all multicast packets on the network will be received by the interface.
metric NSet the interface metric.
mtu NSet the Maximum Transfer Unit (MTU) of an interface.
dstaddr addrSet the remote IP address for a point-to-point (PPP)link (obsolete; use pointopoint instead)
netmask addrSet the IP network mask for this interface. This value defaults to the usual class A, B or C network mask (as derived from the interface IP address), but it can be set to any value.
add addr/prefixlenAdd an IPv6 address to an interface.
del addr/prefixlenRemove an IPv6 address from an interface.
tunnel a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.
irq addrSet the interrupt line used by this device. Not all devices can dynamically change their IRQ setting.
io_addr addrSet the start address in I/O space for this device.
mem_start addrSet the start address for shared memory used by this device. Only a few devices need this.
media typeSet the physical port or medium type to be used by the device. Not all devices can change this setting, and those that can vary in what values they support. Typical values for type are 10base2 (thin Ethernet),10baseT (twisted-pair 10Mbps Ethernet), AUI (external transceiver) and so on. The special medium type of auto can be used to tell the driver to auto-sense the media. Again, not all drivers can do this.
[-]broadcast [addr]If the address argument is given, set the protocol broadcast address for this interface. Otherwise, set (or clear) the IFF_BROADCAST flag for the interface.
[-]pointopoint [addr]This keyword enables the point-to-point mode of an interface,meaning that it is a direct link between two machines with nobody else listening on it. If the address argument is also given, set the protocol address of the other side of the link, just like the obsolete dstaddr keyword does. Otherwise, set or clear the IFF_POINTOPOINT flag for the interface.
hw class addressSet the hardware address of this interface, if the device driver supports this operation. The keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. Hardware classes currently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom (AMPR NET/ROM).
multicastSet the multicast flag on the interface. Not normally be needed as the drivers set the flag correctly themselves.
addressThe IP address to be assigned to this interface.
txqueuelen lengthSet the length of the transmit queue of the device. It is useful to set this to small values for slower devices with a high latency (modem links, ISDN) to prevent fast bulk transfers from disturbing interactive traffic like telnet too much.ifconfig is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.

If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays the status of the given interface only; if a single -a argument is given, it displays the status of all interfaces, even those that are down. Otherwise, it configures an interface.

If the first argument after the interface name is recognized as the name of a supported address family, that address family is used for decoding and displaying all protocol addresses. Currently supported address families include inet (TCP/IP, default), inet6 (IPv6), ax25 (AMPR Packet Radio), ddp (Appletalk Phase 2), ipx (Novell IPX) and netrom (AMPR Packet radio).

All numbers supplied as parts in IPv4 dotted decimal notation may be decimal, octal, or hexadecimal, as specified in the ISO C standard (that is, a leading 0x or 0X implies hexadecimal; otherwise, a leading ''0'' implies octal; otherwise, the number is interpreted as decimal). Use of hexamedial and octal numbers is not RFC-compliant and therefore its use is discouraged and may go away.

About the Author

FortyPoundHead has posted a total of 1974 articles.


Comments On This Post

No comments on this post yet!

Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.

Your IP address is:

Before you can post, you need to prove you are human. If you log in, this test goes away.

Recent Forum Posts

SSL Now Active
dwirch posted on June 16, 2017 at about 8:40 in Site News

SSL Now Active
dwirch posted on June 13, 2017 at about 7:59 in Site News

Coding Archive?
dwirch posted on June 3, 2017 at about 12:54 in Site News

Job Spammer: Bharti Jigyasi
dwirch posted on June 2, 2017 at about 16:57 in Spammers

Coding Archive?
dwirch posted on May 25, 2017 at about 12:38 in Site News

BWASL returns
dwirch posted on May 13, 2017 at about 15:24 in Site News