This is my route table
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
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 18.104.22.168, it will mask it to 22.214.171.124 -> not 192.168.1.0 -> next route -> 126.96.36.199 (same mask) -> not 192.168.0.0 -> next route -> 188.8.131.52 (netmask 255.0.0.0) -> route to eth0
Now let's send a packet to 184.108.40.206 -> 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.
|All times are GMT -5. The time now is 10:15 PM.|