On 19 Feb 2004 08:29:19 -0800, Sting <(E-Mail Removed)> wrote:
> Hello,
> from man route:
> gw GW route packets via a gateway. NOTE: The specified gateway must
> be reachable first. This usually means that you have to set up a
> static route to the gateway beforehand.
>
> What is static route to the gateway ?
> How do you set it ?
It depends whether the gateway is already defined in a route for that
interface (like a local network route). If not, you would typically set a
-host route to gateway IP before using it as a default route. With things
like ppp or pppoe, a route to the gateway (remote ppp IP) is usually
automatic and defaultroute option would set the default route.
It is usually only a concern when doing some sort of special static
networking, like using an IP from 1 network on another interface. For
example:
Router-192.168.1.1-----eth0/eth1-----192.168.1.0/255.255.255.0 network
where eth0 192.168.1.2 netmask 255.255.255.255
eth1 192.168.1.3 netmask 255.255.255.0
In this case bringing up eth1 from scripts would usually automatically set
a local router on eth1 for 192.168.1.0/255.255.255.0 network, but eth0
would have no route. So somewhere you would need to:
route add -host 192.168.1.1 dev eth0
route add default 192.168.1.1 dev eth0
However, for the router set for 192.168.1.1 netmask 255.255.255.0 to
see the rest of that network without having a gateway set for it, besides
enabling ip_forward, proxy arp would have to be enabled for eth0:
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
Then eth0 would answer arp requests from the router for any IPs on eth1.
--
David Efflandt - All spam ignored
http://www.de-srv.com/