From the course: Exploring Linux Internals: Advanced Insights and Practical Applications

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

How Linux chooses a network interface

How Linux chooses a network interface

- So in this video, I would like to show you how we get from IP addresses to actual MAC addresses and how routing is working. So to understand, let's start with the internet. So on the internet we have this host 1.1.1.1, which is listening on at port 80, in fact, port 80, we don't care about the port here, we just care about the nodes, the IP addresses, and the Mac addresses. So let's say we have a router, and just to make it easy, straight router, no net. So on this router, we have an internet-facing interface, which is 2.2.2.2. And we have a private network interface which is 10.0.0.1. Then on the private side, we have this network and we have the node, 10.0.0.2, and 10.0.0.2 wants to go out to the internet. So what is going to happen? Well, 10.0.0.2 would generate a packet. And in that packet, the destination address is 1.1.1.1, and it comes from 10.0.0.2, followed by the payload, as you have seen before. Now at an IP layer, there is no problem to be solved, but this packet needs…

Contents