Pages

Sunday, August 25, 2013

How to Set Up Routing Tables

A routing table is a simple file on a computer that lets the computer know how to find other computers. Specifically, it describes the way a packet needs to go to find another node (computer) on the network. Most modern computers build their own routing tables based on communication between devices (such as computers and routers). The routing table will tell the computer which device (network card, wireless card) to use for a specific list of IP addresses.

Instructions

    1

    View your current routing table with the route command. In Linux, type "route" at a command line, and the system will list the current routing table. This will let you see what has already been set up and what still needs to be configured. In Windows, type "route print" to obtain the current routing table.

    2

    Add the loopback entry for your system. This is done with the command:
    route add -net 127.0.0.1
    This will set up the system to understand that the 127.0.0.1 address belongs to the machine itself.

    3

    Add the default gateway to the routing table. This is done with this command:
    route add default gw gateway_IP_address
    Replace the last parameter, "gateway_IP_address," with the IP address of your gateway computer. This IP address must already be defined, or this command will give you an error.

    4

    Add additional routes if you have additional network cards/devices in your machine:
    route add -net 192.168.1.100 netmask 255.255.0.0 eth2
    This will direct all traffic that starts with 192.168 to the eth2 device on your computer. This would be useful if you have a large local network and need all 192.168 traffic to head in one particular direction.

    5

    Remove unused routes. Routes that you do not need can be removed with the command:
    route delete 192.168.1.100
    This will remove the route that tells the network to use the route associated with the 192.168.1.100 address.

0 comments:

Post a Comment