[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
nat/pf redirection problems
I am using OpenBSD 3.0 as a
firewall/nat gateway and
redirect rules in nat don't
seem to work as I cannot
access the internal webserver
via the public ip address .
The following is my network
layout:
nat.rules:
nat on rl0 from 1.1.1.0/24 to
any -> rl0
rdr on rl0 from any to any
port 80 -> 1.1.1.35 port 80
pf.rules:
ExtIF="rl0" # External
Interface
IntNet="1.1.1.0/24" #
internal network
NoRouteIPs="{ 127.0.0.1/8,
192.168.0.0/16, 172.16.0.0/12,
10.0.0.0/8 }"
Services="{ www, https }"
# Clean up fragmented and
abnormal packets
scrub in all
# don't allow anyone to spoof
non-routeable addresses
block in quick on $ExtIF from
$NoRouteIPs to any
block out quick on $ExtIF from
any to $NoRouteIPs
# only allow our machines to
connect via ssh
pass in quick on $ExtIF inet
proto tcp from $IntNet to any
port = 22
# allow others to use http and
https
pass in quick on $ExtIF inet
proto tcp from any to any port
$Services flags S/SA
# finally lock the rest down
with a default deny
block in quick on $ExtIF from
any to any
# and let out-going traffic
out and maintain state on
established connections
pass out on $ExtIF from any to
any keep state
The webserver is running on
1.1.1.35 and I can access it
via the internal
network. However, when I try
to access the webserver via
the external ip address,
I get no page found. I also
tried using pass in all --
pass out all, and still can't
get to the webserver.