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 “192.168.1.100” 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
UP BROADCAST MULTICAST MTU:1500 Metric:1
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)
Interrupt:17

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
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:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
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
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
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)

Creating SSH Public and Private Key... x
Creating SSH Public and Private Key in Linux / Ubuntu

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux