well when i send a packet with let's say 10.0.0.32/24 it well go to the second line in the table
so it sould be sent to the gateway 10.0.0.201 is't that my computer? what does it mean?
maybe it means th connection my router has with my computer then way would the defalt be to 10.0.0.221??
please help me .........................
maybe i don't understand what exactly gateway is (the ip number of the router that connects me to a other network)
a gateway can be a router. But it can simply be a network interface as in this case. The gateway for the network 10.0.0.0/24 has the IP address 10.0.0.201 which is the address of an interface (physical or virtual) directly located at this machine, right? So packets for this network are sent to the gateway 10.0.0.201 which is not a distant router but instead the entry point to this net from this local machine! And this gateway in turn has to decide what to do with these packets, for example just release them to a ethernet segment, maybe do some address rewriting before or send the packets via a VPN to a remote gateway etc.
As a side note: because the machine is directly connected to the 10.0.0.0/24 network there is no need to use the default gateway 10.0.0.221. The machine can directly access this network and therefore it doesn't use the default gateway!
I hope this helped to explain what you see in your routing table
Joined: Nov 02, 2009
ok that was a lot of help thanks
the local packet is not going to a diffrent network so the gateway is on the network card of this
computer but a packets that is for the internet the gateway is on the router connection with the isp???
write the local packet goes through the router but not really through the table this Straight to the enthrnet connection to the
Basically the routing process works (simplified) as follows:
- A host receives some IP packet and decides, based on the destination IP, if it should process this packed. The machine feels responsible for a packet if a) the destination IP belongs to the machine itself or b) the machine is configured to operate as a router.
- The machine looks at its routing table (usually from top to bottom) in the destination (= first) column for any network or host destination address which matches the destination address of the packet. In this case it will first notice a packet for destination network 10.0.0.0/24 and find in the 2nd line of the routing table that this packet has to be sent to the gateway 10.0.0.201 which is a network interface on the machine, that is the machine will consume the packet itself.
- Now imagine the machine can't find a matching destination net/host in its routing table. It will still process the routing table from top to bottom until it finally reaches the entry for the default gateway (which is a distant remote destination or say your typical internet router). If there is a default gateway in this table the machine will simply send all packets for which it can't find any other (local) destination to this default gateway.
- The default gateway in turn will do exactly the same. It looks in its routing table if there is a destination for the packet in question. If it finds one, it will send the packet to this destination network/host. This can be another LAN directly attached to your default gateway. If your (home) default gateway can't find a matching entry in its routing table it will do the same as the machine before: it will in turn send any packet which doesn't match any destination to its own default gateway (if configured). And the default gateway of your home router is typically a destination at your provider's site!
That's how all network packets which don't belong to any of your local machines or networks usually end up in the internet! It's more or less no explicit routing but rather a fallback with the default gateways.
An additional note: You can try this and remove the default gateway (it isn't required). If there is no matching, explicit routing destination and the packet would end up at the default gateway, you will get a "no route found" error or similar.
10.0.0.221 is the IP address of the interface of your router. It is directly connected to your LAN with this address and therefore can be reached by your other machines through the LAN.
NATting as nothing to do with it. NAT comes into play when the router sends packets from the insided (= LAN) to the outside (= internet). I then modifies all packets an replaces the source IP addresses (which are the ones from you LAN machines) with its own public internet IP address. This is needed because otherwise you wouldn't get a single response for any packet because target machines on the internet wouldn't know how to reach LAN addresses from you home network. But they do know how to reach the public address of your router because the sender IP is, well, public. That's what NAT is for!