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 Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense NDK / Middleware / HAL 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 User Interface Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question