Skip to main content

Linux - How many network cards/interfaces do I have and what's their IP

 Yup! You have your Linux server or desktop installed, you have been enjoying this setup and suddenly you need to know how many network adapters are installed.


You probably also want to know which of these adapters is connected to the internet, please follow through.


First, you should run the command below on the terminal

ip addr


TL; DR: There are 2 network adapters here, “enp0s3” is my internet network adapter because it has an IP address from my internet gateway/router/MiFi. The IP address pattern gives this information.it begins with 192.x.x.x. Also "epn0s8" is the local network adapter which allows connections within an ethernet, 


This output is quite verbose. Let’s dissect it in a bit.

Firstly, we can observe items 1, 2 and 3. It is worth mentioning that item 1 is not an adapter, it is synonymous with the local network.


Item 1 is labelled as “lo:”, this means that details in this section have to do with your localhost. Internal network setting of your system. This is very evident from the fact that the IPV$ address on the third line is the common loopback address aka 127.0.0.1. Whatever happens on this network interface is never leaving your workstation unless others are configured.


Item 2 is labelled as "enp03s". It has an IPV4 address with the pattern as 192.168.x.x. most of the time when you connect your workstation to a network device, the network device will assign an IP to your workstation, this IP will have a pattern as such. If you have multiple devices attached to the same network device(e.g MiFi/WiFi/Router/Modem), only the last parts of the IP will change(not more than the last 2 octets).
This is the adapter that has access to external network/devices, which may also have access to internet services.


Item 3 is labelled as "enp0s8", and the IP assigned is 10.0.2.10. This adapter only has access to other local workstations within the same ethernet. Also, this means that the network interface is not using an automatic DHCP or the DHCP is configured to use this range of IP (e.g., 10.0.x.x). usually, this interface will not have access to the internet.
In some cases, it will be able to send out internet traffic but will not be reachable from outside the local network.

The beauty of Linux is its flexibility, you might encounter situations where a NAT is configured for this IP on the firewall. The NAT could enable smooth inbound and outbound traffic from the internet.


DECIPHERED? Maybe, let's know. Use the comment section to pass your questions and feedback. You can also send private messages.


Thanks for reading, see you later in another mind-opening Linux/System Admin tutorial.

Comments

Popular Articles

Laragon: installing more versions of Apache/HTTPD

Most of the time, we casually install various PHP versions and server tools without checking if they were built for Win32 or Win64. A discussion for another day. I recently downgraded Laragon’s from PHP8.1-x64 to PHP7.x-x86. This had a little consequence - APACHE! Hence, I got the error below, indicating that my PHP and Apache can’t work together because they are of different architectures or builds.   The originally installed Apache was for 64-bit PHP versions, there are no Apache versions designed to run both 32-bit and 64-bit builds of PHP. In this article, I share steps and links that guide you to install multiple versions and builds of Apache on Laragon. 1. For all intent and purposes, you are advised to always download the latest version of Apache. Visit this URL https://www.apachelounge.com/download/additional/ to see the different versions available. It is easy to access the 64-bit versions from the homepage. However, to access the 32-bit versions, you need to use this URL. 2

Resolving Incompatible Builds of PHP and Apache in Laragon: Add multiple versions of Apache

 As developers, it's often the case that different versions of PHP and server tools are installed quickly without taking into account the architecture for which they were built. In this article, we will focus on solving a specific error that arises when running incompatible builds of PHP and Apache. Recently, I encountered an issue when downgrading my Laragon setup from PHP 8.1 (x64) to PHP 7.x (x86). This caused compatibility problems with Apache, and I received an error message indicating that my PHP and Apache builds were not compatible, as the Apache installed was built for x64 versions of PHP. In this article, I'll provide a step-by-step guide on how to install multiple versions of Apache on Laragon. By following these steps, you can resolve any similar issues that you may encounter. Step 1: Download the Latest Version of Apache Visit https://www.apachelounge.com/download/additional/ to download the latest version of Apache. The homepage provides quick access to 64-bit ve

VS CODE: Unable to install extensions on Ubuntu/Linux

Hey, its one of those days, i just wished i could code away the night. i decided that tonight, it was going to be VS Code all through. I closed Sublime text. It was not long before I started missing the php code linting and ever intelligent code completions that were built into sublime text. I checked the suggestions on the Extensions Tab of VS Code. and there it was! Felix Becker's "PHP IntelliSense" package. To my cute surprise, Upon clicking, the extension's description and Installation "Read Me" could not display correctly, 'twas as good as blank. All i could see was this: I thought, this is something light, so i started searching but then it was not better explained except for the GitHub issue which I found to be useful, Link is at the bottom of this page.  I hate to discover it was a DNS issue. How to detect the Issue Simply visit the URL below, if you are able to view the image on the page, then you are not affected by this issue. DNS Test URL: ht