ifconfig
ifconfig is used to configure the kernel-resident network interfaces. It 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.[1]
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.[1]
Documentation
- man 8 'ifconfig' [EN]
Syntax
ifconfig [INTERFACE] [SUBCOMMAND ...]
Subcommands
- [-]arp
- Enable or disable the use of the ARP protocol on this interface.
- [-]broadcast [ADDRESS]
- 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.
- down
- This flag causes the driver for this interface to be shut down.
- mtu AMOUNT
- This parameter sets the Maximum Transfer Unit (MTU) of an interface.
- netmask NETMASK
- Set 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.
- [-]pointopoint [ADDRESS]
- 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.
- [-]promisc
- Enable or disable the promiscuous mode of the interface. If selected, all packets on the network will be received by the interface.
- up
- This flag causes the interface to be activated. It is implicitly specified if an address is assigned to the interface.
Examples
- Configure new network settings
ifconfig 'eth0' '192.168.1.100' netmask '255.255.255.0' broadcast '192.168.1.255'
- Configure a virtual interface
ifconfig 'eth0:1' '192.168.1.101'
- Activate an interface
ifconfig 'eth0' up
- Change the MTU of an interface
ifconfig 'eth0' mtu 1400