How to check IP address, network interface details in Linux ?

If you want to know the IP address and currently active network interfaces on Linux, we need to use “ifconfig” command. The ifconfig command is part of “net-tools” package in ubuntu, hence we first need to make sure it is installed, if its not we need to install it as below,

 $ sudo apt-get install net-tools 

Now, you can check the IP address and network interfaces as, where below “” is current IP address. If you have more than one network interface connected, i.e. Ethernet cable directly connected to your laptop/pc and also laptop/pc is connected to WIFI, you may see the two intefaces with active IP address, in that case Ethernet takes precedence over WiFi, hence you may use Ethernet IP address to access your machine.

 $ ifconfig -a 

enp8s0 Link encap:Ethernet HWaddr 00:26:b9:11:51:48
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:2924 errors:0 dropped:0 overruns:0 frame:0
TX packets:2924 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:290201 (290.2 KB) TX bytes:290201 (290.2 KB)

wlp4s0b1 Link encap:Ethernet HWaddr 0c:60:76:61:ce:49
inet addr: Bcast: Mask:
inet6 addr: fe80::c238:fbab:7238:686f/64 Scope:Link
inet6 addr: 2401:4900:1906:5b2e:d8c7:71f2:457b:2/128 Scope:Global
inet6 addr: 2401:4900:1906:5b2e:ca0f:a0ee:4ee1:274/64 Scope:Global
inet6 addr: 2401:4900:1906:5b2e:e988:3f17:fab3:b493/64 Scope:Global
RX packets:57602 errors:0 dropped:0 overruns:0 frame:0
TX packets:40922 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:57699640 (57.6 MB) TX bytes:6251783 (6.2 MB)

Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Content Management System - CMS Core Kernel C Programs Development Environment Setup Errors & Failures File Systems git Go Language Programs Hardware Platforms Home HTML JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply