Networking Forums

Networking Forums > Computer Networking > Linux Networking > route and static route to a gateway

Reply
Thread Tools Display Modes

route and static route to a gateway

 
 
Sting
Guest
Posts: n/a

 
      02-19-2004, 03:29 PM
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 ?

regards,
sting
 
Reply With Quote
 
 
 
 
MM
Guest
Posts: n/a

 
      02-19-2004, 03:50 PM
Sting 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 ?
>
> regards,
> sting


If your gw isn't connected directly to you you must specify with route
program itself what other machine are from you to gw. If a direct
connection exists you don't do anything.

 
Reply With Quote
 
David Efflandt
Guest
Posts: n/a

 
      02-21-2004, 03:35 AM
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
static route Tom1 Windows Networking 4 09-05-2008 04:21 PM
static route to direct to ISP possible ? -keevill- Wireless Networks 3 04-21-2008 08:22 PM
Adding Static route moncho Windows Networking 5 04-13-2006 07:13 AM
VPN client adds wrong route to local route table snowdog_2112 Windows Networking 7 11-01-2005 02:05 PM
procedures for static route? Andre Windows Networking 2 10-08-2004 11:11 PM



1 2 3 4 5 6 7 8 9 10 11