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 Answer
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 ♦Commented Feb 13, 2013 at 20:32
-
or you could put it in your
~/.bash_profile
but that would only work if you live in the terminal Commented Dec 6, 2018 at 16:17 -
1Unfortunately ipfw has been deprecated. How to achieve the same using pfctl tool?– EazyCommented Feb 5, 2020 at 4:06
http://localhost:9790
in the browser. I assume this is not an option for you?