Wednesday, November 10, 2010

How Old Are Goldfish In Pet Store

commands for network management in Linux: Commands

with the route command can control the basic routing. To view the routing table is only necessary to execute: route



And the result is:




Gateway Destination ; Genmask Indic Metric Ref Use Interface

172.20.0.0   *                       255.255.0.0   U     1      0    0   eth0

link-local   *                       255.255.0.0   U     1000   0  
0 eth0 default router.trombotic.tic 0.0.0.0 UG 0 0 , 0 eth0
Executed this way, route attempts to resolve names of IP addresses that appear on the roads, and if the dns is not configured or fails, the result takes a while to get out. To avoid this route can be used with the-n:
route-n
And the result is: Table Kernel IP routing



Destination Gateway Genmask Indic Metric Ref Use interface
172.20.0.0 0.0.0.0 255.255.255.0 U
1 0 0 eth0

169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 172.20.0.1 0.0.0.0 UG 0 0 0 eth0
To modify the table enrutameinto adding a new route, you need to add several options:
route add-net 10.0.0.0 netmask 255.0.0.0 gw 172.20.0.2
In this case it is adding a new route to the network ( destination) 10.0.0.0 with mask (destination network) 255.0.0.0 through the gateway (router) 172.20.0.2. To enter the default gateway is running:

route add-net 0.0.0.0 netmask 0.0.0.0 gw 172.20.0.2

is important to remember that the ip address and mask should be 0.0.0.0 . When deleting routes running the route command like this:



route del-net 10.0.0.0 netmask 255.0.0.0 gw 172.20.0.2

When there is only one route to the network you want to delete, it is necessary to put the gw. It is enough:

route del-net 10.0.0.0 netmask 255.0.0.0



0 comments:

Post a Comment