ipfw="/sbin/ipfw -q"
officenet="192.168.0.0/24"
officeprefix="192.168.0"
iif="xl0"
oif="vr0"
echo "Enabling firewall.."
${ipfw} -f flush
###### Localhost
#
${ipfw} add 00127 allow ip from any to any via lo0
${ipfw} add 00128 deny ip from any to 127.0.0.0/8
${ipfw} add 00129 deny ip from 127.0.0.0/8 to any
#
######
######
#
# SSH
${ipfw} add 00220 allow tcp from any to any 22 in via ${oif}
# SMTP
${ipfw} add 00230 allow tcp from any to any 25 in via ${oif}
# HTTP
${ipfw} add 00250 allow tcp from any to any 80 in via ${oif}
# DNS
${ipfw} add 00260 allow tcp from any to any 53 in via ${oif}
${ipfw} add 00261 allow udp from any to any 53 in via ${iif}
# FTP
${ipfw} add 00262 allow tcp from any to any 21 in via ${oif}
${ipfw} add 00263 allow tcp from any to any 20 in via ${oif}
${ipfw} add 00264 allow tcp from any 21 to any via ${oif}
#
######
###### NATD stuff
#
${ipfw} add 00300 divert natd all from any to any via ${oif}
#
######
###### Network connection's stuff
#
${ipfw} add 00410 check-state
${ipfw} add 00421 allow all from me to any via ${iif} keep-state
${ipfw} add 00422 allow all from me to any via ${oif} keep-state
${ipfw} add 00423 allow all from any to me via ${oif} keep-state
${ipfw} add 00427 allow all from 192.168.0.5 to any via ${iif} keep-state
${ipfw} add 00428 allow all from 192.168.0.5 to any via ${oif} keep-state
${ipfw} add 00429 allow all from 192.168.0.6 to any via ${iif} keep-state
${ipfw} add 00430 allow all from 192.168.0.6 to any via ${oif} keep-state
${ipfw} add 00432 allow all from any to any 21,22,25,53,80,110,3128,5000
${ipfw} add 00450 allow all from any to any via ${oif} keep-state
#
######
###### ICMP stuff
#
${ipfw} add 00510 allow icmp from any to any icmptypes 8
${ipfw} add 00511 allow icmp from any to any icmptypes 0
#
######
Гуру БСД подскажите пожалуйста, что нужно добавить в моем конфиге фаерволла? Подключаюсь по опенвп , сеть внутренняя пингуеться, а вот по сети на компы попасть не могу.
officenet="192.168.0.0/24"
officeprefix="192.168.0"
iif="xl0"
oif="vr0"
echo "Enabling firewall.."
${ipfw} -f flush
###### Localhost
#
${ipfw} add 00127 allow ip from any to any via lo0
${ipfw} add 00128 deny ip from any to 127.0.0.0/8
${ipfw} add 00129 deny ip from 127.0.0.0/8 to any
#
######
######
#
# SSH
${ipfw} add 00220 allow tcp from any to any 22 in via ${oif}
# SMTP
${ipfw} add 00230 allow tcp from any to any 25 in via ${oif}
# HTTP
${ipfw} add 00250 allow tcp from any to any 80 in via ${oif}
# DNS
${ipfw} add 00260 allow tcp from any to any 53 in via ${oif}
${ipfw} add 00261 allow udp from any to any 53 in via ${iif}
# FTP
${ipfw} add 00262 allow tcp from any to any 21 in via ${oif}
${ipfw} add 00263 allow tcp from any to any 20 in via ${oif}
${ipfw} add 00264 allow tcp from any 21 to any via ${oif}
#
######
###### NATD stuff
#
${ipfw} add 00300 divert natd all from any to any via ${oif}
#
######
###### Network connection's stuff
#
${ipfw} add 00410 check-state
${ipfw} add 00421 allow all from me to any via ${iif} keep-state
${ipfw} add 00422 allow all from me to any via ${oif} keep-state
${ipfw} add 00423 allow all from any to me via ${oif} keep-state
${ipfw} add 00427 allow all from 192.168.0.5 to any via ${iif} keep-state
${ipfw} add 00428 allow all from 192.168.0.5 to any via ${oif} keep-state
${ipfw} add 00429 allow all from 192.168.0.6 to any via ${iif} keep-state
${ipfw} add 00430 allow all from 192.168.0.6 to any via ${oif} keep-state
${ipfw} add 00432 allow all from any to any 21,22,25,53,80,110,3128,5000
${ipfw} add 00450 allow all from any to any via ${oif} keep-state
#
######
###### ICMP stuff
#
${ipfw} add 00510 allow icmp from any to any icmptypes 8
${ipfw} add 00511 allow icmp from any to any icmptypes 0
#
######
Гуру БСД подскажите пожалуйста, что нужно добавить в моем конфиге фаерволла? Подключаюсь по опенвп , сеть внутренняя пингуеться, а вот по сети на компы попасть не могу.