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 IPV4 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

[SOLVED] Linux - Issues installing Docker on Ubuntu - libseccomp2 version 2.3.1 installed but 2.4 required

This article has been improved for a better understanding - goto  https://splashcoder.blogspot.com/2023/07/installing-docker-on-ubuntu-1804-solved.html There is a possibility that you are trying to install docker. There is a very comprehensive guide at https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository. The linked guide serves as a reference for this article. We try to address the common errors in this article. Just so you won’t have to scour the entire answers on StackOverflow. Step 1: The first thing is to run our famous "apt update" command. So run the command below. sudo apt-get update You may observe that there are some errors. And YES! we are using a fairly old Ubuntu 18.04 Bionic Beaver Release. It seems perfect for this as most people have issues installing docker anyways. To resolve this, you may refer to  Configure DNS server IP to resolve errors with apt-get update Step 2: Following the Docker article, we should run the commands below. sudo...

Linux - Configure DNS server IP to resolve errors with apt-get update

Perhaps you have a new install of Ubuntu, and you are about to install docker or any other Linux packages. The first step is to update the application repositories using the sudo apt update command. There is a very small possibility that you will get the error below if you are using a fresh install of the Ubuntu 18.04 LTS (Bionic Beaver). This error simply means that Linux is unable to connect to the official repository likely due to a DNS configuration or a network issue. Here we try to help you resolve the DNS issue. To resolve this, you must specify a DNS in your network settings. Well, there is one popular DNS that works well: Google's DNS. Follow through, please. STEP 1: Go to the settings page of Linux (Ubuntu) STEP 2: This should reveal a plethora of options. On the left pane, simply scroll down and click Network as shown below. This reveals your different network connections, for me, “enp0s3” is the adapter connecter to the internet. So, I must configure DNS for “enp0s3”. ...

Installing Docker on Ubuntu 18.04 ([SOLVED]- libseccomp2 version 2.3.1 installed but 2.4 required)

 Introduction: If you're attempting to install Docker on Ubuntu 18.04 Bionic Beaver, which is known for having installation issues, this comprehensive guide aims to address common errors you may encounter during the process. Our goal is to save you time searching for answers on StackOverflow by providing clear instructions. The guide is based on the official Docker documentation available at https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository. Step 1: Updating Package Lists To begin, run the following command to update your package lists using the "apt-get update" command: sudo apt-get update Note: If you encounter any errors during the update process, it may be due to the older Ubuntu 18.04 release. In such cases, you can refer to the Configure DNS server IP to resolve errors with apt-get update  guide for assistance. This guide will help you address any DNS-related issues that might be preventing successful updates. Step 2: Installing Dependencie...