I want to ask a question about route command in Linux. I have enter following command in Linux terminal
> route
and got the output:
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 1 0 0 eth0
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
link-local * 255.255.0.0 U 1000 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
I don’t understand it. Does this mean that any packet with ip 192.168.1.0 will go out from * gateway?
Why is it DESTINATION written there shouldn’t it be source because the packet going out from my host have source IP of 192.168.1.0?
Can anyone explain me the meaning of this entry in terms of packet going out and coming to my host?
Let’s go through the lines one by one:
This says that any packet with a destination of 192.168.1.0 through 192.168.1.255 will be sent out
eth0without using a gateway (unless a more-specific route overrides this one).This says that any packet with a destination of 192.168.122.0 through 192.168.122.255 will be sent out
virbr0without using a gateway. (Again, unless a more-specific route overrides this one.)This says that any packet with a link-local address will be sent out interface
eth0with no gateway.This says that any packet to a destination without another route will be sent out
eth0, using 192.168.1.1 as a gateway.