Dave's Brain

Browse - Computer Tips - How does a packet know how to get to the internet?

Date: 2016feb25
OS: Linux
Level: beginner

Q.  How does a packet know how to get to the internet?

A.  You can list the routing table with the route command:

route
Example output:
Destination Gateway Genmask Flags Metric Ref Use Iface default my-router 0.0.0.0 UG 100 0 0 enp2s0 192.168.50.0 0.0.0.0 255.255.255.0 U 100 0 0 enp2s0
Or without resoluving the IP-addesses:
route -n
Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.50.1 0.0.0.0 UG 100 0 0 enp2s0 192.168.50.0 0.0.0.0 255.255.255.0 U 100 0 0 enp2s0

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.