Re: How to select IP address for outgoing packets?

From: Alexander Clouter (alex_at_digriz.junk-this.org.uk)
Date: 04/28/05


Date: Thu, 28 Apr 2005 16:34:03 -0000

On 2005-04-28, Graham Murray <gmurray@webwayone.co.uk> wrote:
> [snipped]
>
> However I have been unable to force outgoing connections from the
> Linux system to use the IP address which I want. For most things this
> does not matter but I have the requirement to set up a VPN, which
> requires fixed endpoint addresses, from this system. I have tried
> setting the source address in the 'ip route' command, but this has no
> effect. I tried setting SNAT in the iptables 'nat' OUTPUT table, but
> SNAT is not valid in that table.
>
> [1] I know that this is not the best setup, but the ISP supplied the
> ADSL router and we do not have access to change its configuration.
>
Source based routing is what you are after.

http://lartc.org/howto/lartc.rpdb.html

You create a custom routing table for the VPN traffic and set its 'default
route' to use a particular source address.

In your system (main) routing table you have a route that simply tells the
kernel to use your custom table for 'vpn' traffic.

Have fun

Alex



Relevant Pages

  • Re: Cannot access LAN computers when connecting from externally via VPN.
    ... Our "route" information ... the VPN from working if the VPN DHCP range is 172.16.2.x? ... >The RRAS server will also act as a routing server in the same time. ...
    (microsoft.public.isa)
  • RE: How to switch between two network paths?
    ... Add a persistent route in the routing tables of the machines for the others respective networks ... Machine 1 is located, through the gateway, routed into a VPN tunnel, out ... Then I set the metric for the default gateways of both Machines (these are the routes for the ...
    (microsoft.public.win2000.networking)
  • Re: IP Routing
    ... After the VPN connection is established, there should be a default route ... added to the TCP/IP routing table. ...
    (microsoft.public.pocketpc.developer.networking)
  • Re: Direct Dial Routing Issue
    ... I believe the issue I'm having is with the static routing. ... Directly from the VPN machines, ... Tracing route to 172.16.1.2 over a maximum of 30 hops ...
    (microsoft.public.win2000.ras_routing)
  • Re: GPS Newbie Questions
    ... route form A to B with some constraints (that is not highways, ... units that allow custom routing? ... None of the nuvi allow PC routing to be downloaded to the gps -- HOWEVER ...
    (sci.geo.satellite-nav)