Port Fowarding
How would i go about port forwarding in openbsd?
|
|
Thanks i found it.
|
I set it up according to the man pages but it doesn't seem to be working. I have an apache webserver running on 10.0.0.4. I can see the apache page when i go directly to 10.0.0.1, through a web broswer, but when i go to 10.0.0.1 (the router which should be forwarding port 80 to 10.0.0.4) nothing comes up.
Code:
r# vi /etc/pf.conf |
I solved half the problem, if i change the redirection line to read: rdr on $int_if proto tcp from any to ($int_if) port 80 -> 10.0.0.4. I can now access websites but when i try to access the apache page through the router my browser tries to load it but eventually times out.
|
That's because you can't redirect traffic from a particular subnet back to that same subnet. Are you really trying to send all traffic coming from your internal network and going to port 80 back to another host on the internal network? Usually redirection is used to send traffic from the outside to a particular internal host, i.e. a rdr on the ext_if not the int_if.
|
rdr on $ext_if proto tcp from any to ($int_if) port 80 -> 10.0.0.4. That still doesn't work. Basically want to do here is allow my server to be accessed by the outside world. If I have a webserver running on a subnet wouldn't the url of the gateway of the subnet show the webpage?
|
Why would the internal gateway IP display the web page that is hosted on another machine? What you need is
Code:
rdr on $ext_if proto tcp from any to ($ext_if) port http -> 10.0.0.4 You'll also need to allow the redirected packets to pass through with one of the following: Code:
pass in on $ext_if proto tcp from any to ($ext_if) port http flags S/SA keep state |
Code:
ext_if="rl0" |
I got it working. My DHCP lease ran out and my router assigned it a different address. Thanks a lot chort.
|
All times are GMT -5. The time now is 03:25 PM. |