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

Issue with installing python-axolotl or python-axolotl-curve25519 on Windows

It is peeve amazing how many hours get burnt while trying to resolve simple package dependency issues. I may be too dumb to proffer a lasting one-fits-all solution to all dependency issues, but I got this issue fixed in my own case. Problem Description: The python-axolotl library requires certain dependencies that are not properly managed when installing libraries via a command line's requirement.txt file. I got real help by reading through this link below, but this page might be more helpful when it comes to detailed instructions. Actual instructions: https://github.com/tgalal/python-axolotl Typical errors might look like the following: 1. In this case, missing library(s). Libraries needed for compiling some python resources. Unfortunately, http://aka.ms/vcpython27  has been decommissioned because Python2x is EOL. You can still get the VcPython27 from an archive at https://web.archive.org/web/20210106040222/download.microsoft.com/download/7/9/6/796EF2E4-801B-4F...

Chrome Extension (part 1): Injecting External Scripts into a Web Page

Recently, I was required to develop a chrome extension for some executives. This plugin only targeted a few of our most visited websites. There was a lot of approaches to implement the extension and all our use cases. One particular challenge was trying to inject scripts from our own CDN into specific web pages. the scripts were required to interact with the page and all variables possible. Since there is a script isolation thing for Chrome Extensions, I felt this was a good challenge to take up in my spare time. Here is a sample of my content script. content.js document.onreadystatechange = function () { console.log("document state is:" + document.readyState); if (document.readyState == "complete") { let randAntiCache = Math.random().toString().split('.')[1]; let scriptURL4="http://localhost.test/testscript.js?v="+randAntiCache; let scriptnode4 = document.createElement("script"); scriptnode4.setAttribute("s...

Who is this Brown Skin Girl?

In the recent wake of a great musical sensation and a re-make of the famous Lion King movie, Beyonce has been on the global selection of artistes to share performances. Today, I will try to examine the poetry of the track titled Brown Skin Girl, All interpretations in this article are my personal candid opinion. so feel free to share yours in the comments section, i will be glad to add it to my edits. So while I may not pretty boy; your heart is amiss; Play it like a villain `cause she caught in a wave This paints the picture of a guy who feels He is not good enough for the lady of his dreams, so he said Tonight I am walking away Lined up my mind, on the grind yeah yeah meaning he tryin' to give up. But then in the chorus, He said Tonight I might fall in love Depending on how you hold me I'm glad that I'm calming down can't let no one come control me So this dude aint feeling he's the kinda guy for bae, but bae be doubting if she still want...