Hi there,
I've been trying and changing almost everything I could think of to make this work, until now without any success. I even asked google(!), but no luck there. Sorry to ask, but would anybody please take a look at my configs and tell me, what am I missing?
I have a piece of hardware at my provider's place and intend to use it for different purposes, though everything should only be installed in jails.
I can access any website from inside the jail and have already installed ports without difficulty. Then I've installed lighttpd and php-fpm inside jail as webserver and I got port 80 opened.
Cheers and thanks in advance,
A.
/etc/rc.conf:
/etc/rc.conf.local:
/etc/natd.rules:
BTW: I wasn't sure if the problem is with Firewall or my routing, so I've posted here.
I've been trying and changing almost everything I could think of to make this work, until now without any success. I even asked google(!), but no luck there. Sorry to ask, but would anybody please take a look at my configs and tell me, what am I missing?
I have a piece of hardware at my provider's place and intend to use it for different purposes, though everything should only be installed in jails.
I can access any website from inside the jail and have already installed ports without difficulty. Then I've installed lighttpd and php-fpm inside jail as webserver and I got port 80 opened.
Cheers and thanks in advance,
A.
/etc/rc.conf:
Code:
# IPFW:
firewall_enable="YES"
firewall_nat_enable="YES"
firewall_type="filename"
firewall_script="/etc/ipfw.rules"
firewall_logging="YES"
firewall_quite="NO"
gateway_enable="YES"
## NAT
natd_enable="YES"
natd_interface="re0"
natd_flags="-f /etc/natd.rules"
/etc/rc.conf.local:
Code:
ifconfig_re0="inet x.y.z.76 netmask 0xffffffe0 media 1000baseT mediaopt full-duplex"
defaultrouter="x.y.z.65" # Server from Provider
ifconfig_re0_ipv6="inet6 accept_rtadv"
ifconfig_re0_alias0="inet 10.0.1.1 netmask 0xffffff00"
ifconfig_re0_alias1="inet 10.0.1.2 netmask 0xffffff00"
ifconfig_re0_alias2="inet 10.0.1.3 netmask 0xffffff00"
ifconfig_re0_alias3="inet 10.0.1.4 netmask 0xffffff00"
ipfw list
Code:
00010 allow ip from any to any via lo0
00050 divert 8668 ip from any to any in via re0
00100 check-state
00110 skipto 800 tcp from any to any dst-port 37,43,67,119,25,110,53,80,443,2022 out via re0 setup keep-state
00112 skipto 800 icmp from any to any out via re0 keep-state
00114 skipto 800 tcp from any to xx.xx.xx.xx1 dst-port 53 out via re0 setup keep-state
00115 skipto 800 udp from any to xx.xx.xx.xx1 out via re0 keep-state
00116 skipto 800 tcp from any to xx.xx.xx.xx2 dst-port 53 out via re0 setup keep-state
00117 skipto 800 udp from any to xx.xx.xx.xx2 out via re0 keep-state
00118 skipto 800 tcp from any to xx.xx.xx.xx3 dst-port 53 out via re0 setup keep-state
00119 skipto 800 udp from any to xx.xx.xx.xx3 out via re0 keep-state
00130 skipto 800 udp from any to any dst-port 123 out via re0 keep-state
00140 skipto 800 log logamount 10 udp from any to any dst-port 67 out via re0 keep-state
00150 skipto 800 tcp from me to any out via re0 setup uid root keep-state
00299 deny log logamount 10 tcp from any to any out via re0
00300 deny ip from 192.168.0.0/16 to any in via re0
00301 deny ip from 172.16.0.0/12 to any in via re0
00302 deny ip from 10.0.0.0/8 to any in via re0
00303 deny ip from 127.0.0.0/8 to any in via re0
00304 deny ip from 0.0.0.0/8 to any in via re0
00305 deny ip from 169.254.0.0/16 to any in via re0
00306 deny ip from 192.0.2.0/24 to any in via re0
00307 deny ip from 204.152.64.0/23 to any in via re0
00308 deny ip from 224.0.0.0/3 to any in via re0
00315 deny tcp from any to any dst-port 113 in via re0
00320 deny tcp from any to any dst-port 137 in via re0
00321 deny tcp from any to any dst-port 138 in via re0
00322 deny tcp from any to any dst-port 139 in via re0
00323 deny tcp from any to any dst-port 81 in via re0
00330 deny ip from any to any frag in via re0
00335 deny tcp from any to any established in via re0
00350 allow tcp from any to me dst-port 80 in via re0 setup limit src-addr 4
00355 allow tcp from any to me dst-port 443 in via re0 setup limit src-addr 4
00410 allow tcp from any to me dst-port 2022 in via re0 setup limit src-addr 8
00420 allow icmp from any to any in via re0 icmptypes 0,3,8,11
00440 deny log logamount 10 ip from any to any in via re0
00450 deny log logamount 10 ip from any to any out via re0
00800 divert 8668 ip from any to any out via re0
00810 allow ip from any to any
00999 deny log logamount 10 ip from any to any
65535 deny ip from any to any
/etc/natd.rules:
Code:
dynamic yes
redirect_port tcp 10.0.1.1:80 80
redirect_port tcp 10.0.1.1:443 443
netstat -rfinet
Code:
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default static.65.82.9.5.c UGS re0
5.9.82.64/27 link#1 U re0
static.76.82.9.5.c link#1 UHS lo0
10.0.1.0 link#1 U re0
10.0.1.1 link#1 UHS lo0
10.0.1.2 link#1 UHS lo0
10.0.1.3 link#1 UHS lo0
10.0.1.4 link#1 UHS lo0
localhost link#2 UH lo0
BTW: I wasn't sure if the problem is with Firewall or my routing, so I've posted here.