Professional Documents
Culture Documents
Route Linux
Route Linux
Irtt
*
0
Gateway
Iface
Genmask
0
*
40
0
0
192.168.10.1
0
Flags
255.255.255.0 U
eth0
255.0.0.0
0
lo
0.0.0.0
UG
eth0
This configures the network and the default gateway. However, in this case, 192.
168.10.1 knows nothing about the 10.0.0.0 network, so your packets would get los
t because 192.168.10.1 has no idea where to send the packets and will attempt to
send them through the default gateway. You need to add another routing statemen
t to each system in the 192.168.10.0 network like this:
route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.10.25
This command tells the kernel to route all packets destined for the 10.0.0.0 net
work to 192.168.10.25, which it defines as a gateway. So now, by using the three
route commands, your kernel will know where to send packets. In this situation,
a few things happen:
Packets to 192.168.10.0 are handled without a gateway.
Packets to 10.0.0.0 are sent to the defined gateway, 192.168.10.25.
Packets traveling anywhere else are sent to the default gateway, 192.168.10.1.