Routing internal requests to external IPs
Hey everyone. Does anyone have a good resource/idea about how to solve the following issue for a client of mine?
They have an mobile device that switches from mobile network to wifi when wifi is available. An external IP is being used as an alias on the firewall to route incoming traffic to an internal mail server. The problem is that when the mobile device is used in the office, the device tries to access the external IP and fails to connect.
I know that there is something that stops internal requests to external IPs that route back to an internal machine from working from within the network.
Right now the solution is to turn off the wifi in the office and force the phone back on the mobile network to connect.
Is there a way to analyze outgoing requests and route them directly to an internal machine?
My client would like to be able to leave the wifi setting as is and take advantage of the speed.
When the device is in the office, you could run a simple shell script that adapts it's network setting to the office situation.
Another possibility is to run a cron job every minute or so. When the device fails to connect to the external IP, adjust the network settings.
On my OpenBSD desktop, I use the following script in cron to start the ntpd daemon when I have network access, and just forget about it when there isn't .
#!/bin/sh # ---- to be used in root's crontab for machines not always connected GATEWAY=192.168.222.10 date if pgrep ntpd >/dev/null 2>&1 ; then echo ntpd already running exit 0 fi if ping -c3 $GATEWAY >&2 ; then # connection to gateway exists echo Starting ntpd .... ntpd -s exit 0 else echo "Gateway not alive, cannot run ntpd" exit 1 fi
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
|Thread||Thread Starter||Forum||Replies||Last Post|
|Redirect Internal Network to Internal Website||plexter||OpenBSD Security||12||12th February 2009 08:00 PM|
|Problem pinging internal nic||JustDoIt||OpenBSD General||16||19th August 2008 08:16 PM|
|fetchmail: POP3< -ERR internal server error||graudeejs||FreeBSD General||3||19th July 2008 02:02 PM|
|NIC with internal cable; how to remove?||TerryP||Off-Topic||9||14th July 2008 06:33 AM|
|2 external NIC + 1 internal NIC||AlexV||FreeBSD General||7||4th June 2008 08:18 AM|