DEV Community

Cover image for ifconfig vs ipconfig vs iwconfig
Naniyori
Naniyori

Posted on

ifconfig vs ipconfig vs iwconfig

This may seem useless to a lot of people, even I am thinking that way but still I got this confusion when I started learning a bit networking and started working in Linux terminal so maybe other also have this confusion and these are the basic commands especially for those who works with networking stuff. It’s really very basic. So, what is the difference between ifconfig, iwconfig and ipconfig?

Ifconfig stands for interface configuration and it’s used to display the network configuration information, you come to know about your IP address for your Wi-Fi router, for your LAN cable, for any interface that’s connecting you from the internet and this command provides options for viewing as well as changing your network settings. Well, I am not going to go very deep in it and show you the various options it offers like “ifconfig –a” it shows you all the network interfaces while using just “ifconfig” only shows the current active network interfaces. So, I guess now you have a basic idea of what is ifconfig and what it shows you but there’s a lot you can do after knowing this info, maybe you would like to change your MAC address, configuring IP address or any other thing you would like to do. Alt Text

Ipconfig stands for internet protocol configuration and actually is not much different than ifconfig. While ifconfig works only in Unix based OS, ipconfig works in even in windows and some new versions of Linux too. Ipconfig is a better option than ifconfig, it’s sort of upgraded version of ifconfig. It’s new but it doesn’t mean that it’s superior to the previous one. Things that you can do with ifconfig, can be done with ipconfig, they just have their own ways of doing things but the same thing can be done by both of these commands. However, there are some advantages of ipconfig over ifconfig for example unlike ifconfig, it also displays all currently connected network interfaces whether they are active or not. So, between ifconfig and ipconfig, ifconfig can meet all the basic requirement of our work but now or later, we may have to upgrade, as ipconfig have some more features and ifconfig have some drawbacks. Alt Text

Iwconfig is also similar to ifconfig, but it is only dedicated to wireless networking interfaces means not wired interface like a ethernet cable, LAN cable. It only shows wireless interface. You can change the parameters of that network interface, parameters related to Wi-Fi adapter like transmit power, changing bit rate, changing SSID name and other things are also possible.

To know more about any of these commands, you can give a try to their documentation online or you can just type “man ifconfig” and it’ll open the manual for this command or you can try using “iwconfig –help”. Alt Text

I guess now you can understand what’s the basic difference between ifconfig, ipconfig and iwconfig and how are they different. Currently, the most basic and widely used command among these is ifconfig.
PS :- Please do correct me if I am wrong somewhere.

Top comments (5)

Collapse
 
jimmy19742 profile image
jimmy19742

You can use IP command and its subcommands

Like ip link(Manage and display the state of all network
interfaces
) : a few examples :

ip link
Show information for all interfaces
ip link show dev em1
Display information only for device em1
ip link - - help for a brief overview

ip route
List all of the route entries in the kernel

ip neigh
Display neighbour objects

ip neigh show dev em1
Show the ARP cache for device em1

ip maddr
Display multicast information for all devices

ip maddr show dev em1
Display multicast information for device em1

IP address and MAC address can be assigned new values to via their sub-sub commands

Add an address
ip addr add 192.168.1.1/24 dev em1
Add address 192.168.1.1 with netmask 24 to device em1

addr del :Delete an address
ip addr del 192.168.1.1/24 dev em1
Remove address 192.168.1.1/24 from device em1

link set :Alter the status of the interface

ip link set em1 up
Bring em1 online

ip link set em1 down
Bring em1 offline

ip link set em1 mtu 9000
Set the MTU on em1 to 9000

Add an entry to the routing table

ip route add default via 192.168.1.1 dev em1
Add a default route (for all addresses) via the local gateway
192.168.1.1 that can be reached on device em1

ip route add 192.168.1.0/24 via 192.168.1.1
Add a route to 192.168.1.0/24 via the gateway at
192.168.1.1

ip route add 192.168.1.0/24 dev em1
Add a route to 192.168.1.0/24 that can be reached on
device em1

route delete Delete a routing table entry
ip route delete 192.168.1.0/24 via 192.168.1.1

Replace, or add if not defined, a route

ip route replace 192.168.1.0/24 dev em1
Replace the defined route for 192.168.1.0/24 to use
device em1

route get Display the route

ip route get 192.168.1.5
Display the route taken for IP 192.168.1.5

That's my favourite:

ss
Display socket statistics. The below options can be combined
ss -a
Show all sockets (listening and non-listening)
ss -e
Show detailed socket information
ss -o
Show timer information
ss -n
Do not resolve addresses
ss -p
Show process using the socket

There are commands for observation of traffic
nc( net cat). - - help
nm ( network mapper)
netstat
etc

That's not all indeed but I hope it will be of help

Collapse
 
salimf profile image
SalimF

Thank you so much you solve my fresh installed Arch IPv4 address isseu, damn it was too hard to figureout what cause the issue, looks like iwctl didn't assing IPv4 to my Wifi network connection at all .
This should be dedicated post on it own, many people need this.

Collapse
 
jimmy19742 profile image
jimmy19742

nmap ( network mapper) and not nm

Sorry!

Collapse
 
jimmy19742 profile image
jimmy19742

probably off topic but I have encountered that nmap is short for Network Manager.
A few more NFS ( Network File System ) commands:
nmcli

hostname

dhcclient

ethtool ( to get or to change network card settings) i.e ethtool eth0 | grep speed
and so on

Collapse
 
deepu14d profile image
Naniyori

Thanks for this adding this precious information.