cheat.sheets:ifconfig
# ifconfig
# Configure a network interface (deprecated, replaced by ip command).
# Display all network interfaces and their configuration
ifconfig
# View configuration details for a specific interface (e.g., eth0)
ifconfig eth0
# Enable a network interface (e.g., eth0)
ifconfig eth0 up
# Disable a network interface (e.g., eth0)
ifconfig eth0 down
# Assign an IP address to an interface (e.g., eth0)
ifconfig eth0 192.168.1.10
# Set a subnet mask on a network interface
ifconfig eth0 netmask 255.255.255.0
# Add an alias for a network interface with a separate IP address
ifconfig eth0:0 192.168.1.20
# Remove alias from a network interface
ifconfig eth0:0 down
# Set a broadcast address on a network interface
ifconfig eth0 broadcast 192.168.1.255
# Change the MAC address of a network interface
ifconfig eth0 hw ether 00:11:22:33:44:55
cheat:ifconfig
# To display network settings of an interface:
ifconfig <interface>
# To display all interfaces, even if down:
ifconfig -a
# To take down / up the wireless adapter:
ifconfig wlan0 {up|down}
# To set a static IP and netmask:
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
# You may also need to add a gateway IP:
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
tldr:ifconfig
# ifconfig
# Network Interface Configurator.
# More information: <https://net-tools.sourceforge.io/man/ifconfig.8.html>.
# View network settings of an Ethernet adapter:
ifconfig eth0
# Display details of all interfaces, including disabled interfaces:
ifconfig -a
# Disable eth0 interface:
ifconfig eth0 down
# Enable eth0 interface:
ifconfig eth0 up
# Assign IP address to eth0 interface:
ifconfig eth0 ip_address
$
cheat.sh