LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 10-14-2005, 10:06 AM   #1
props666999
Member
 
Registered: Oct 2003
Location: Greece
Posts: 260

Rep: Reputation: 30
routing tables


Hello

This is my route table

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
84.0.0.0        0.0.0.0         255.0.0.0       U     0      0      0         eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         84.x.xx.xx     0.0.0.0         UG    0      0        0 eth0
the 192.168.1.0 is binded to eth2

the ip adreess for that computer is 192.168.1.1

is the 192.168.1.0 referred to the subnetwork which is binded to eth2

but on eth2 the ifconfig reports ip address 192.168.1.1

please clarify

thanks
 
Old 10-14-2005, 09:27 PM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
your ip adress is 192.168.1.1 on eth2 with a netmask of 255.255.255.0
in binary form, 255 is 11111111 and 0 is 00000000
it means that the first 3 bytes of your ip adress determine the network and the last byte is unique in the network.
the network adress is 192.168.1.0 (it's your ip adress OR'd with your netmask (you only take the bits which are 1 in the netmask)). No machine can have the adress 192.168.1.0 in your subnet because it is reserved for the network adress. Same for 192.168.1.255 which is the broadcast adress (sending to everybody in the subnet).

so when you send a packet to 192.168.1.17, it will mask it with the netmask -> 192.168.1.0 and route it to eth2
if you send a packet to 84.17.17.17, it will mask it to 84.17.17.0 -> not 192.168.1.0 -> next route -> 84.17.17.0 (same mask) -> not 192.168.0.0 -> next route -> 84.0.0.0 (netmask 255.0.0.0) -> route to eth0
Now let's send a packet to 17.17.17.17 -> not eth2, not eth1, not eth0, not lo0 -> 0.0.0.0 (default gateway) -> eth0 (again).
It means that your third route is useless, because anything (x.x.x.x) that is not 192.168.0.x, 192.168.1.x or 127.x.x.x will be routed to eth0 anyway (in particular 84.x.x.x)

Note about the netmask : the 1s are always first and the 0s are last (you can not have a netmask of 0.0.255.255 for instance)
We also say that your adress is 192.168.1.1/24, because there are 24 bits with a value of 1 in your netmask.

Last edited by Agrouf; 10-14-2005 at 09:32 PM.
 
  


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
Routing tables TPB Linux - Networking 3 07-27-2005 10:01 PM
IP Routing Tables collern2 Linux - Security 1 05-23-2005 11:48 AM
two routing tables fugzi Linux - Networking 7 12-03-2004 07:02 PM
routing tables help hadoque Linux - Networking 0 08-28-2004 10:10 AM
routing tables dunkyb Linux - Networking 3 05-25-2003 03:10 PM


All times are GMT -5. The time now is 04:44 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration