controlling source IP on connections

Rich Mahn rich at lat.com
Tue Jun 14 14:39:09 UTC 2011


Hi,
  I use openvpn as a tunnel between my office LAN and my home LAN.  It works
great with one exception.  Connections through the tunnel originating at the
VPN endpoints use the tunnel IP address as their source address.  I need the
local IP address to be used instead.

  More specifically:

office LAN == 66.66.66.0/24
home LAN   == 192.168.1.0/24
VPN uses  192.168.1.1 on home side
VPN uses  66.66.66.1 on office side
VPN tunnel is 192.168.2.1 (office) <==> 192.168.2.2 (home)

Problem is that connections from 192.168.1.1 to 66.66.66.xx
use 192.168.2.2 as the source IP.  Similarly connections from
66.66.66.1 to 192.168.1.xx use 192.168.2.1 as the source IP.

Is there some way I can get them to use 192.168.1.1 and 66.66.66.1
respectively.  I looked at iptables, but don't see what looks correct
there.  Maybe the 'mangle' table, but I don't see any modifications to
source or destination.

Thanks for any help or pointers.  Or if it just can't be done, it would
be nice to know that as well.

Rich




More information about the users mailing list