|
|
ipfw and port forwarding
|
|
|
|
Senior User
Join Date: Jul 2000
Status:
Offline
|
|
I thought I could use ipfw for this, but for the life of me, I can't figure it out. Other suggestions would be wonderful.
I use EIMS for OSX as my mail server. I want to setup and ADDITIONAL port to use for SMTP. I'd like to have EIMS listen on 25, and 1025 but, EIMS can only be configured to run on a single port for smtp. I figure that I could setup some rule in ipfw that would take all incoming requests on port 1025 and forward them to 25 instead (even if I have to do this on a per IP basis, I'm good with that).
I've looked into using 'divert', but it forwards ALL request to a single port. The 'fwd' command looks like what I want, but it doesn't seem to work, or at least not in the manner I think it should .
Any suggestions on how to do this with what is installed on OSXS? Or, do I have to use a real proxy app like squid or something? I figured this would be easier than it is turning out to be.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Jul 2000
Status:
Offline
|
|
Well, I've got a few solutions. First off, EIMS has a way to do an additional port. Its the 'smtp submission' port in the Prefs. This is defaulted to 587.
Next, I found a simple little util that will do exactly what I want:
http://sourceforge.net/projects/simpleproxy/
Usage for my case:
# simpleproxy -L 1025 -R localhost:25 &
It compiled with no problems on OSX 10.2 and OSXS 10.2.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Another solution is to use SSH port forwarding. Requires no additional software.
Something like this should work:
Code:
ssh -f -g -L 1025:localhost:25 localhost "while true ; do sleep 100; done"
SSH port forwarding is useful in a lot of ways. This is a pretty trivial example but it would suit your needs.
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Badfort
Status:
Offline
|
|
|
You see, my friends, pirates are the key. - thalo
|
|
|
|
|
|
|
|
Senior User
Join Date: Jul 2000
Status:
Offline
|
|
Excellent, thanks for the great tips. I got this from another source:
% sudo ipfw add fwd 192.168.1.1,25 tcp from any to 192.168.1.1 1025 in
I was mixing up the ports. I inverted the 1025 and 25 so it didn't work. I didn't even thing to do this... ugh.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|