-   Linux - Newbie (
-   -   static routes (

fdelval 08-03-2010 05:34 PM

static routes
Hello, i have an ubuntu server which im configuring as router.

In one interface i have internet, and in the other one i have LAN, and it works ok, i can surf the net, set up a server etc etc

Now i have a curiosity, my lan is in eth0

Can i add a pc in that lan with ip: (note different subnet) and add a route policy like: route add gw through eth0 ???

If thats not possible, what are static routes for? any practical example??

lartman 08-03-2010 08:03 PM

route add eth0
sets up a host route. There is no need for a gateway as localhost is the router.

route add -net netmask eth0
does the subnet.

The simpler way is to assign to eth0 as a second address and let the route be implied.

All times are GMT -5. The time now is 06:57 AM.