7

I want when on my local machine redirect from 192.168.64.88 port 80 to localhost port 9790. How can I do it with ipfw rule?

  • 1
    Poor man's solution would be to use http://localhost:9790 in the browser. I assume this is not an option for you? – nohillside Feb 4 '13 at 12:56
  • It is not an option – Eldar Feb 4 '13 at 12:57
6

I found the solution:

sudo ifconfig lo0 192.168.64.88 alias
sudo ipfw add fwd 127.0.0.1,9790 tcp from me to 192.168.64.88 dst-port 80

After a restart you have to run this commands again.

  • You can define a launchd entry to automatically execute these commands on a reboot. – nohillside Feb 13 '13 at 20:32
  • or you could put it in your ~/.bash_profile but that would only work if you live in the terminal – Chris Rutherford Dec 6 '18 at 16:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .