🖥️ifconfig
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the ifconfig command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗███████╗ ██████╗ ██████╗ ███╗ ██╗███████╗██╗ ██████╗
# ██║██╔════╝██╔════╝██╔═══██╗████╗ ██║██╔════╝██║██╔════╝
# ██║█████╗ ██║ ██║ ██║██╔██╗ ██║█████╗ ██║██║ ███╗
# ██║██╔══╝ ██║ ██║ ██║██║╚██╗██║██╔══╝ ██║██║ ██║
# ██║██║ ╚██████╗╚██████╔╝██║ ╚████║██║ ██║╚██████╔╝
# ╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝
# Display network settings of the first ethernet adapter
ifconfig wlan0
# Display all interfaces, even if down
ifconfig -a
# Take down / up the wireless adapter
ifconfig wlan0 {up|down}
# Set a static IP and netmask
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
ifconfig $(route -n |awk '/0[.]0[.]0[.]0/{print $NF;exit}') | awk '/inet/{print $2}'
# Get primary IP of the local machine
# 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
# Get primary IP of the local machine
ifconfig $(route -n |awk '/0[.]0[.]0[.]0/{print $NF;exit}') | awk '/inet/{print $2}'
#==============================##==============================#
# CMD IFCONFIG #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command ifconfig in a clear format. This allows users to quickly access the needed information for ifconfig without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for ifconfig are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.