Bind source IP to VPN?


I have written a Python script that uses the following code to send some information to a server:

data = urllib.urlencode( report ) # url encode the data
results = urllib2.urlopen(url, data) # open url and send up data
with open(“results.html”, “w”) as f:

This code works great on the Digi, but I would like to force it to connect through the IPSec VPN tunnel. By default, the Python code binds to the PPP address as its source IP and thus the socket connection and subsequent data transfer happen outside of the VPN tunnel. I’ve tried using NAT statements to change the source address (and destination) to an ‘in-tunnel’ IP address, but it still goes out on the PPP interface (I can see this in the analyzer), just with the ‘in-tunnel’ address… which fails completely of course.

I am hoping that this is a common problem that your guys have dealt with already, and I am just not thinking of the correct solution. Any advice?

**note, the last line of code on my previous post should be indented…

I figured this out using a combination of NAT statements in the firewall and by setting "Configuration-Network>Advanced Network Settings->Socket Settings->“Default source IP address interface” to Eth 0, which was the key. Thanks to James @Digi tech support for pointing out this option to me!