UNIX Routing Tables


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers UNIX Routing Tables
# 1  
Old 11-13-2015
UNIX Routing Tables

I'm trying to learn the basic in's and out's of networking on my own through the use of a book. When it comes to routing tables I'm completely lost. I apologize for the alignment of the table below. The book vaguely explains routing tables, then has the following example:

Code:
E15.3) Consider the following netstat –rn output from a Linux system. Describe the routes and figure out the network setup. 
Which network 10.0.0.0 or 10.1.1.0, is closer to the Internet? Which process added each route? 

Destination	Gateway	    Genmask	   	Flags	  MMS	  Iface
10.0.0.0     	0.0.0.0	   255.255.255.0	U	  40 	           eth1
10.1.1.0     	0.0.0.0	   255.255.255.0	U	  40	           eth0
0.0.0.0	        10.0.0.1	     0.0.0.0			UG	  40             eth1

From my understanding, there are two networks - 10.0.0.0 & 10.1.1.0. Neither required a gateway, and are both listed as up (u) with a maximum segment size of 40. For packet(s) to leave the network and reach the internet they are passed to 0.0.0.0 to reach the 10.0.0.1 gateway. In terms of which is closer to the internet, I'd say that 10.0.0.0 is closer since it is also located on eth1, but I'm honestly not sure. In terms of which process is added to each route, that doesn't even make sense to me.

If anyone has any insight into routing tables and this example it would be greatly appreciated. Thank you!
# 2  
Old 11-13-2015
The designation of how the "default gateway" is represented varies by OS.

Here, in this case look for the flag UG.

You may want to look at "ip" and "ip route". That tool replaces netstart -rn. With "ip" could can create more complex routing scenarios.

Consider the commands:
Code:
ip route list
ip rule show
ip route show table main

Implication... you can add (for example) your own route tables.
See more (an example) at: NTLUG | Calendar / Calendar February 25, 2012 browse
# 3  
Old 11-13-2015
Thank you cjcox. I appreciate the help. For now I'm trying to understand this example before moving on to more complex scenarios.
# 4  
Old 11-13-2015
What the example says is this:

If you want to send to a system in the 10.0.0.0 network, you don't have to use a gateway (router). Just send the packet out of the eth1 interface and the destination system will receive your message directly.

If you want to send to a system in the 10.1.1.0 network, you also don't have to use a gateway. Just send the packet out of the eth0 interface and the destination system will receive your message directly.

In every other case, send the message to the gateway system (10.0.0.1) and hope that this machine will know how to deliver your message. Use the eth1 interface to reach the gateway.

Did that help?
This User Gave Thanks to hergp For This Post:
# 5  
Old 11-13-2015
Thank you, Hergp, that does help!

In terms of which is closer to the actually internet - would it be 10.0.0.0 or 10.1.1.0, or neither? I still don't understand that part of the question, or "which processes were added to each route." Thank you.
# 6  
Old 11-13-2015
Doesn't really make much sense to say which is closer, however you could at least say that the default gateway of 10.0.0.1 is out through eth1 on the 10.0.0.0/24 network.

Your host knows where the default gateway is and how to get there.... so closeness isn't an issue.

Your host knows about the 10.0.0.0/24 network on eth1 and knows about the 10.1.1.0/24 network on eth0.

All internet traffic will go out eth1 because it doesn't know about those networks and that's where the default gateway can be found.

(assumes that the default gateway knows how to get to those Internet addresses)
This User Gave Thanks to cjcox For This Post:
# 7  
Old 11-13-2015
Thank you, Cjcox! That's a huge help. Do you understand what they mean by which processes were added to each route? That makes no sense to me.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Unable to send attachment with html tables in UNIX shell script

Heyy, any help would be grateful.... LOOKING FOR THE WAYS TO SEND AN EMAIL WITH ATTACHMENT & HTML TABLES IN BODY THROUGH SHELL SCRIPT (LINUX)..NOT SURE, IF WE HAVE ANY INBUILT HTML TAG OR UNIX COMMAND TO SEND THE ATTACHMENTS. KINDLY HELP below is small script posted for our understanding..... (2 Replies)
Discussion started by: Harsha Vardhan
2 Replies

2. Shell Programming and Scripting

How to use V$tables in UNIX shell script?

Hi All, In my script I have used the below code to retrieve the instance name V_INSTANCE_NAME=`sqlplus -s ${APPS_USR_PSWD} <<+ set pagesize 0 linesize 256 feedback off verify off head off echo off set serveroutput off select... (2 Replies)
Discussion started by: kalidoss
2 Replies

3. Shell Programming and Scripting

Howto compare the columns of 2 diff tables of 2 different schemas in UNIX shell script

HI All, I am new to Unix shell scripts.. Could you please post the unix shell script for for the below request., There are two different tables(sample1, sample2) in different schemas(s_schema1, s_schema2). Unix shell script to compare the columns of two different tables of two... (2 Replies)
Discussion started by: Rajkumar Gopal
2 Replies

4. UNIX for Advanced & Expert Users

HELP me please. UNIX Routing

Hello everybody, I need help: I have to make routing between two different LAN. I have the IP for first network 81.180.75.70 and the mask is 255.255.255.192 and for the second network: 192.168.1.1 and the mask 255.255.255.0 So, each network has only one PC with windows (this is for test),... (11 Replies)
Discussion started by: meorfi
11 Replies

5. UNIX for Dummies Questions & Answers

HELP me please. UNIX Routing

Hello everybody, I need help: I have to make routing between two different LAN. I have the IP for first network 81.180.75.70 and the mask is 255.255.255.192 and for the second network: 192.168.1.1 and the mask 255.255.255.0 So, each network has only one PC with windows (this is for test),... (0 Replies)
Discussion started by: meorfi
0 Replies

6. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

7. UNIX for Dummies Questions & Answers

Routing tables

Hey guys, I needed to add a route to my routing table and I got it to work but on reboot it gets removed. Anyone know what file I can add this route to so it stays on the machine after a reboot? (9 Replies)
Discussion started by: kingdbag
9 Replies

8. IP Networking

any system call in unix to access ip routing table

hi is there any system call by which ip routing table can be accessed. (1 Reply)
Discussion started by: vinodkumar
1 Replies

9. UNIX for Advanced & Expert Users

writing database tables into a file in unix

I want to collect the database tables(Ex: Emp,Sal,Bonus...etc) in a file & give this file at the command prompt, when prompted for the tables list at command prompt. How can i do that ? Ex:- Import jason/jason1 tables=emp,sal,bonus log=j1.log i want to change this into Ex:- Import... (3 Replies)
Discussion started by: dreams5617
3 Replies

10. UNIX for Dummies Questions & Answers

Routing DSL to Unix from Windows

I'm brand new to this forum AND Unix. For obvious reasons. I don't know much at all. I'm 14 and i just got my first UNIX SPARCstation5 SUN computer. Something like that. i set up Solaris 9.1(With the help from my dad), now that i've gotten pertty much everything settled, i would like to route my... (8 Replies)
Discussion started by: SoulCheese
8 Replies
Login or Register to Ask a Question