route add
-
Saturday, August 18, 2012 10:22 PMHello folks with a doubt to the route command, as I am studying for proof infra
the training kit says:
10.0.0.0 255.0.0.0 onlink 192.168.2.102 21
"The computer is configured to send traffic destined for network 10.0.0.0 to the router on 192.168.2.102"
Now if we run the print command the field where this address is 192.168.2.102 network interface, as can be the router?
Already in the line below reads:
0.0.0.0 .0.0.0.0 192.168.1.1 192.168.1.198 25
"This shows the default gateway set to 192.168.1.1 to 192.168.1.98 interface"
Now it shows that the interface is 192.168.1.198, and the first command tells the router address is 192.168.2.102
I would like to understand what the difference of the two lines, for me the address 192.168.2.102 is the interface and not the router.- Edited by J.Carlos.Rib Saturday, August 18, 2012 10:22 PM erde
All Replies
-
Sunday, August 19, 2012 12:21 AM
No. The destination address precedes the interface address (which is optional) . If there is an interface address it comes at the end.
The first command says "send all traffic for the subnet 10.0.0.0/8 to the address 192.168.2.102" (which is the IP address of the target router). No interface address is specified.
The second command says "send all traffic which does not have a specific address to the gateway router at 192.168.1.1 using interface 192.168.1.198".
Note. If you are not familiar with the 10.0.0.0/8 convention, it is a shorthand way of writing 10.0.0.0 mask 255.0.0.0 .
The number after the slash is the number of bits in the subnet mask.
For example, 192.168.1.0 mask 255.255.255.0 would be 192.168.1.0/24 .
Bill
-
Sunday, August 19, 2012 1:52 PMOk, thank you
However analyzing a command route print below:
10.0.0.0 255.0.0.0 21 192.168.2.102 onlink
0.0.0.0 .0.0.0.0 192.168.1.1 192.168.1.198 25
How can you know which lines this by specifying the interface of a computer or router?
I can not know the address 192.168.2.102 is a router or a computer
Just as I can not know the address 192.168.1.198 is a router or a computer.
So my doubt is, how can you know for example taking the two lines mentioned above, which is the interface of a router or computer?
thank you -
Monday, August 20, 2012 2:33 AM
There is no difference between a router or a computer. A computer can be an IP router. The only difference you can tell from the command is whether the IP represents a target address (ie the address of another device) or an interface on the local machine.
If there is only one address, it is the target address (ie the device to which the packet will be sent, computer or router). If there are two addresses, the first is the target address and the second is the interface on the local machine through which the packet will be sent to the target.
Bill
- Proposed As Answer by Rick TanModerator Tuesday, August 21, 2012 3:37 AM
- Marked As Answer by J.Carlos.Rib Tuesday, August 21, 2012 3:53 PM

