DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 8th July 2009
jdude jdude is offline
New User
 
Join Date: Jul 2009
Posts: 1
Default 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.

Thanks.

JJO
Reply With Quote
  #2   (View Single Post)  
Old 9th July 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

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 .
Code:
#!/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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT. The time now is 03:40 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick