Before saying anything, I would like you to know that my experience in the field of network administration is about 3 days long, so please treat me like the newbie I am. I have also been looking around 2 of these 3 days trying to find the best way to achieve my objective, and I have found similar questions around the internet, but I have not been able to do it.
I am running an Apache2 server on localhost:8080 from a Mac OS X fully updated Lion. This Mac is connected through Ethernet (interface
en0) to a wireless Access Point. In the AP, I have set up the gateway to be 220.127.116.11, and I have given that IP address to
en0. The objective of this network is redirecting anyone's http/https petitions to the localhost of the gateway, showing them the page that apache is serving.
-If before this point there's any conceptual mistake, please let me know-
As far as I have understood, the best way to do this redirection is using the
pf.conf file and
pfctl, but the man page of
pf.conf left me with a bit of a WTF face. I have found in freebsdonline.com these instructions to do something similar:
# --------- pf.conf ---------- int_if="fxp0" ext_if="fxp1" rdr on $int_if inet proto tcp from any to any port www -> 127.0.0.1 port 8080 pass in on $int_if inet proto tcp from any to 127.0.0.1 port 8080 keep state pass out on $ext_if inet proto tcp from any to any port www keep state # ------- end pf.conf -------
The thing is that this
pf.conf seems to be forwarding packets between 2 interfaces, and I dont need that (do I?). Could you help me to adapt, or at least understand that lines? And is there anything else I need to do once that lines have been added to
P.S: If you know any easier way of doing this redirection stuff, I'll be glad to hear it. I though about using
dnsspoof, but I haven't been able to find it for OSX.