On OS X 10.6 you do not have
iptables, so what is the full solution for this permanently redirect all request sent to port 80 to another port, like 8080?
It has to be persistent.
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Use ipfw as in @bindbn's answer. That's the general idea.
put your rules into a file :
add at the very top of your file
add to /Library/LaunchDaemons/com.yourdomain.ipfw.plist :
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.yourdomain.ipfw</string> <key>Program</key> <string>/sbin/ipfw</string> <key>ProgramArguments</key> <array> <string>/sbin/ipfw</string> <string>-q</string> <string>/etc/ipfw.conf</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
Either reboot, or
launchctl load -w /Library/LaunchDaemons/com.yourdomain.ipfw.plist
the first time.
After that it is
launchctl load com.yourdomain.ipfw
ipfw add NUMBER fwd 127.0.0.1,8080 tcp from any to me 80
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?