Wednesday, July 11, 2007

adding static route howto

A route is is used by your kernel to determine how to get someplace on a network. Routes are stored in the linux kernel and are accessible for viewing and editing to users.

Working with routes.

To view your current default route

# route -n

The result table would look like this

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface U 0 0 0 eth0 UG 0 0 0 lo UG 0 0 0 eth0

To add a route you must first know the network address of the network you wish to add, and the gateway to that network. Let us say we need to add the network of with netmask to be routed to as its default gateway. here is how to do it:

# route add -net netmask gw

This would add the network with a netmask of and a gateway routed to

Basically that's it.

You can also try an anternative route command

# ip route



Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy