Re: Adding a new route



On 28 Aug 2006, in the Usenet newsgroup comp.os.linux.networking, in article
<1156772631.889941.214140@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, robert wrote:

1) I get an IP and default gw from DHCP.

and that default gateway leads to the world.

2) I need to sometimes connect to an external vpn. To do this, I use a
program called pptpconfig .
3) When connecting via pptpconfig, I authenticate but the same default
gw is there. So:

original dhcp gw: 10.101.44.1
vpn gw I need to use sometimes: 192.168.2.101

OK - STOP right there. The route to the world is through 10.101.44.1.
Where does 192.168.2.101 lead to? The world? Or some very limited
number of hosts.

route del default gw 10.101.44.1
route add default gw 192.168.2.101

That gives me everything on the vpn, but then I don't have internate /
local lan access.

OK - look at your routing table (/sbin/route -n). You should see something
like:

[example ~]$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.101.44.0 0.0.0.0 255.255.255.0 U 0 0 89948 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 388 lo
0.0.0.0 10.101.44.1 0.0.0.0 UG 0 0 2673 eth0
[example ~]$

That says that 10.101.44.0 through 10.101.44.255 is _DIRECTLY_ connected
to the eth0 interface. 127.0.0.0 through 127.255.255.255 is on the loopback
interface, AND EVERYTHING ELSE IS REACHABLE BY HANDING IT TO 10.101.44.1.
You are confusing the term 'gateway' and 'default gateway'. They are not
the same function.

How can I get both the vpn and local lan access.

Set up the correct routes. 192.168.2.101 apparently doesn't lead to the
world, so do not tell your computer that it does. Perhaps your VPN routing
setup leads to 172.16.0.0/12 (172.16.0.0 to 172.31.255.255). Set that route
(the syntax is "/sbin/route add -net 172.16.0.0 netmask 255.240.0.0 gw
192.168.2.101"). 192.168.2.101 is _A_ gateway to some networks. A _default_
gateway is a gateway that leads to the world (really, everywhere OTHER THAN
the routes you have already defined).

Old guy
.



Relevant Pages

  • Re: gateway_enable question
    ... >>I have a few win boxes which use my FreeBSD box as a gateway to ... >>How do I disable the gateway option without rebooting? ... Bluescreen leads to downtime. ...
    (freebsd-questions)
  • Re: Multiple NICs
    ... Only the nic on the subnet that leads ... out of the system (Internet?) should have a Default Gateway. ...
    (microsoft.public.windows.server.networking)
  • Re: VPN and remote gateway
    ... > It seems you use the wrong route add command. ... > when the VPN connection is established. ... > | using the remote network as my gateway. ...
    (microsoft.public.windows.server.sbs)
  • Re: Persistent Route ignored on W2K when destination network is unavailable
    ... a global setting like the gateway to a particular subnet should be set ... this network access the internet via a NAT firewall (connected to ... via a WAN link. ... route on the Cisco firewall so that any traffic to the internet gets ...
    (microsoft.public.win2000.networking)
  • Re: AIX 1.3 Failures and Fables
    ... DESTINATION GATEWAY FLGS REFCNT USE INTERFACE ... Is my interpretation of the AIX 1.3 #man route correct? ... Manually manipulates the routing tables. ... Is the destination host or network. ...
    (comp.sys.ibm.ps2.hardware)