LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-02-2007, 09:17 AM   #1
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Rep: Reputation: 30
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.
 
Old 12-02-2007, 10:45 AM   #2
camorri
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

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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...
 
Old 12-02-2007, 10:46 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 12-02-2007, 11:05 AM   #4
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
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
 
Old 12-02-2007, 05:22 PM   #5
camorri
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

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
The snow has turned to freezing rain in the last two hours. You can have that too....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use proxy-arp and NAT to route an "alien" computer to the Internet? mson77 Linux - Networking 14 10-19-2009 11:01 PM
rtorrent "max_open_files" explanation truthe Linux - Software 0 10-17-2006 03:51 AM
Using "sed" - a simple explanation needed midiox Linux - Newbie 2 04-03-2006 07:47 AM
Route to subnet exists but I get "Network unreachable" when adding default route fciuffani Linux - Networking 4 08-18-2004 03:11 PM
Permanently set "route add" -host and default gw sacants Linux - Newbie 1 07-18-2003 05:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration