Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-02-2007, 09:17 AM
|
#1
|
Member
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299
Rep:
|
An explanation of my "route -n" output.
Hi guys and gals,
A wet and windy Sunday afternoon here so I'm playing about on my linux box wondering about which silly questions I need answering.
I've always been a bit puzzled about the output of the route command.
My linux machine ( from which I issue the route command) has IP of 192.168.0.11 and is connected to a gateway machine ( from which I share a net connection) with IP 192.168.0.1. Here is the output of route -n
Code:
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 10 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 10 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 10 0 0 eth0
Could someone kindly aid in interpreting the above ? Basically I would like enlightening on what it all means. Why is my Linux box not represented here ?
Thanks again !
Uncle
ps: Gateway Machine has two NICs installed.
|
|
|
12-02-2007, 10:45 AM
|
#2
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,321
|
The route command is used to work with the kernels routing table. Simply put, this is where the kernel goes to decide where to send a IP packet. It is like an address book of connections, moving the IP packet to its next router, toward its destination.
Your system is a host, and belongs to sub-net 192.168.0.x. If you want to route packets to yourself, notice you have an entry 127.0.0.0 sub-net. So if you were to ping 127.0.0.1, the kernel sees 127.0.0.0 in the routing table, and forwards the packet to interface 'lo' ( your system ).
What is not so easy to understand is on a system with a single interface, why do you need it? Where else can it go you ask? It is set up so you can have many interfaces, connecting to many networks. You can if you want turn your system into a router, with several interfaces. Then it would make more sense to us humans, go look in the routing table to figure out which interface to send out any specific packet on.
BTW, its snowing here too, just cleaned out the driveway...
|
|
|
12-02-2007, 10:46 AM
|
#3
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
The first line is for the route to your LAN. Your lan has a network address of 192.168.0.0/24.
The second line is a link-local route. It is intended for use only by the local networks data-link network layer only. Apple uses it for zero-conf. In Linux, avahi understands zero-conf and other similar protocols.
The third line is the route for local-host. Which I'm sure you know about.
The last line is for the default gateway. Notice the G under the flag. The G is for gateway. Note the 0.0.0.0 for the netmask.
---
edit
We got several inches ourselves. I'm going to collect a few buckets of snow latter to melt for plant water.
Last edited by jschiwal; 12-02-2007 at 10:48 AM.
|
|
|
12-02-2007, 11:05 AM
|
#4
|
Member
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299
Original Poster
Rep:
|
Thanks a lot ! A clear and succinct explanation as usual.
Could we have some of your snow ? We have been longing for a white Christmas in London for decades !
Regards,
Uncle
|
|
|
12-02-2007, 05:22 PM
|
#5
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,321
|
The snow has turned to freezing rain in the last two hours. You can have that too....
|
|
|
All times are GMT -5. The time now is 12:25 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|