View Single Post
Posts: 131 | Thanked: 62 times | Joined on Feb 2010
#12
When I use OpenVPN to do just this, OpenVPN connects back to my server on a given addressort which is configured in the OpenVPN config files say

my.router.public.ipaddress:1400 UPD, whatever your router is setup for

which is port forwarded through my broadband router to my server on

192.168.0.10:1400 UDP, whatever your internal network address is.

The VPN tunnel is configured to address 192.168.200.1/30 on the server end of the tunnel and 192.168.200.2/30 for the N900 end of the tunnel.

OpenVPN creates TUN0 as an interface on the N900 with network 192.168.200.0 subnet 255.255.255.252 which will of course route all TCP/UDP sessions destined for networks that are routed over TUN0, hint: setup a route for 192.168.0.0 via 192.168.200.2 for the N900 in the OpenVPN config file.

my smtp mail relay server now listens on both addressort

192.168.200.1:25 and
192.168.0.10:25

Since it is now effectively multi-homed and I can use either address on the N900 since I can reach the 192.168.200.1 address directly and I can route to 192.168.0.10 via 192.168.200.0 from the N900.

The vpn tunnel merely creates a private route direct to my mail server and therefore I can initiate any TCP session over it as I choose.

You can start/stop openvpn very easily via the command line and use different configs as you choose as command line parameters.

I haven't used SSH to tunnel for SMTP this way so can't help you with that.

rgds

Last edited by uTMY; 2010-05-28 at 21:00.
 

The Following 3 Users Say Thank You to uTMY For This Useful Post: