I'm trying to connect across a VPN to a subnet that can only route packets that appear to originate on a specific subnet. So if the destination network is 192.168.1.0/24 and I set up my home network on 192.168.15.0/24 then I can connect without a problem. But if I set up my own network to be, say, 192.168.50.0/24 then it won't work because the network can't route the packets properly.
So, the setup I have looks something like this:
My machine
192.168.15.155/32
|
v
NAT/Router
|
v
Internet
|
v
VPN Machine
w.x.y.z
|
v
Subnet
192.168.1.0/24
However, as soon as I hit the road, I encouter all sorts of problems since not many networks use 192.168.15.0/24.
I *believe* that I can resolve this by setting up a virtual adapter/IP and then routing packets across it accordingly so that all traffic for 192.168.1.x appears to originate from my virtual IP of 192.168.15.155. This would allow me to connect from any subnet if I can figure out the right commands to add the virtual IP and configure the routing table.
I'm guessing that I need some combination of:
the-knife> ifconfig en0 inet 192.168.15.155 netmask 255.255.255.248 alias
the-knife> route add 192.168.1.0/24 192.168.15.155
But that doesn't seem to do quite what I want (i.e. it hoses the connection). I'm sure that I've got either the route command wrong (becauase the second IP set should really the VPN machine or something) or I need to configure the virtual adapter differently.
Can anyone give me a hand?
thanks.