Имеется проблема - не могу заставить работать почтовик (The Bat) внутри локалки.Все время пишут, что нет соединения с сервером
Имеем FreeBSD 7.2 ipfw + squid. Подключено 2 провайдера.
один комп вылазит в инет мимо squid (192.168.0.25) На нем почтовик работает, на всей остальной локалке - нет
Я никак не могу понять, что я не правильно прописываю и почему не хочет работать (прописываю в ipfw, т.к. мне кажется что squid это не касается)
Код: Выделить всё
00001 0 0 allow tcp from any to ${IpOut} dst-port 25 in via sr0 setup
00002 0 0 allow tcp from any to ${IpOut} dst-port 110 in via sr0 setup
00010 0 0 nat 125 tcp from 192.168.0.101 3389 to any xmit ${IpOut2}
00011 0 0 skipto 50 tcp from 192.168.0.101 3389 to any xmit ${IpOut2}
00012 0 0 nat 126 tcp from 192.168.0.101 3389 to any xmit ${IpOut}
00013 0 0 skipto 50 tcp from 192.168.0.101 3389 to any xmit ${IpOut}
00020 0 0 nat 124 icmp from any to any recv is0
00021 0 0 skipto 30 icmp from any to any recv is0
00022 0 0 nat 124 tcp from any to me dst-port 1025-65535 recv is0
00023 109 20558 nat 124 udp from any to me dst-port 1025-65535 recv is0
00024 0 0 nat 124 icmp from 192.168.0.0/23 to any xmit is0
00025 0 0 skipto 30 icmp from 192.168.0.0/23 to any xmit is0
00026 0 0 nat 124 ip4 from table(2) 1025-65535 to any xmit is0
00027 0 0 nat 124 ip4 from table(3) 1025-65535 to any xmit is0
00030 0 0 nat 125 icmp from any to any recv 78.29.8.62
00031 0 0 skipto 40 icmp from any to any recv 78.29.8.62
00032 0 0 nat 125 tcp from any to me dst-port 1025-65535 recv ${IpOut2}
00033 0 0 nat 125 udp from any to me dst-port 1025-65535 recv ${IpOut2}
00034 0 0 nat 125 icmp from 192.168.0.0/23 to any xmit ${IpOut2}
00035 0 0 skipto 40 icmp from 192.168.0.0/23 to any xmit ${IpOut2}
00036 0 0 nat 125 ip4 from table(2) 1025-65535 to any xmit ${IpOut2}
00037 0 0 nat 125 ip4 from table(3) 1025-65535 to any xmit ${IpOut2}
00037 0 0 nat 125 ip4 from 192.168.100.0/24 to any xmit 78.29.8.62
00040 25 1636 nat 126 icmp from any to any recv ${IpOut}
00041 1 56 skipto 50 icmp from any to any recv ${IpOut}
00042 6445 6726004 nat 126 tcp from any to me dst-port 1025-65535 recv ${IpOut}
00043 115 10756 nat 126 udp from any to me dst-port 1025-65535 recv ${IpOut}
00044 0 0 nat 126 icmp from 192.168.0.0/23 to any xmit ${IpOut}
00045 0 0 skipto 50 icmp from 192.168.0.0/23 to any xmit ${IpOut}
00046 485 69142 nat 126 ip4 from table(2) 1025-65535 to any xmit ${IpOut}
00047 0 0 nat 126 ip4 from 192.168.100.0/24 to any xmit ${IpOut}
00100 8344 1501346 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
01100 511 71101 allow ip4 from table(2) to not me
01200 0 0 allow ip4 from table(3) to not me
01300 1054 310322 allow ip4 from not me to table(2)
01400 0 0 allow ip4 from not me to table(3)
01500 474 91165 allow tcp from 192.168.0.101 3389 to any
01600 452 77843 allow tcp from any to 192.168.0.101 dst-port 3389
02100 6139 6550284 allow ip4 from me to 192.168.0.0/23 xmit lan0
02200 3992 317816 allow ip4 from 192.168.0.0/23 to me recv lan0
03100 0 0 allow ip4 from 192.168.0.0/23 to table(6) dst-port 53
03100 0 0 allow ip4 from table(6) 53 to 192.168.0.0/23
03200 523 47071 allow ip4 from 192.168.0.0/23 to 192.168.0.0/23 via lan0
03300 1080 78863 deny ip4 from 192.168.0.0/23 to not me
03400 0 0 deny ip4 from not me to 192.168.0.0/23
65000 11550 7082891 allow ip4 from any to any
65533 0 0 deny log ip4 from any to any
65534 11 792 deny log ip from any to any
65535 8 482 deny ip from any to any
Код: Выделить всё
#!/bin/sh -
# $FreeBSD: src/etc/rc.firewall,v 1.52.2.3.4.1 2009/04/15 03:14:26 kensmith Exp $
# Setup system for ipfw(4) firewall service.
#. /etc/rc.subr
#. /etc/network.subr
#name="ipfw"
#load_rc_config $name
# Suck in the configuration variables.
if [ -z "${source_rc_confs_defined}" ]; then
if [ -r /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
source_rc_confs
elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf
elif [ -r /etc/rc.conf.local ]; then
. /etc/rc.conf.local
fi
if [ -r /etc/rc.conf.d/ipfw ]; then
. /etc/rc.conf.d/ipfw
fi
fi
setup_loopback () {
############
# Only in rare cases do you want to change these rules
#
${fwcmd} add 100 pass all from any to any via lo0
${fwcmd} add 200 deny all from any to 127.0.0.0/8
${fwcmd} add 300 deny ip from 127.0.0.0/8 to any
}
if [ -n "${1}" ]; then
firewall_type="${1}"
fi
############
# Set quiet mode if requested
#
case ${firewall_quiet} in
[Yy][Ee][Ss])
fwcmd="/sbin/ipfw -q"
;;
*)
fwcmd="/sbin/ipfw"
;;
esac
############
# Flush out the list before we begin.
#
${fwcmd} -f flush
setup_loopback
############
# Network Address Translation. All packets are passed to natd(8) before they encounter your remaining rules. The firewall rules
# will then be run again on each packet after translation by natd starting at the rule number following the divert rule.
# For ``simple'' firewall type the divert rule should be put to a different place to not interfere with address-checking rules.
case ${firewall_type} in
[Oo][Pp][Ee][Nn]|[Cc][Ll][Ii][Ee][Nn][Tt])
case ${natd_enable} in
[Yy][Ee][Ss])
if [ -n "${natd_interface}" ]; then
${fwcmd} add 50 divert natd ip4 from any to any via ${natd_interface}
fi
;;
esac
case ${firewall_nat_enable} in
[Yy][Ee][Ss])
if [ -n "${firewall_nat_interface}" ]; then
if echo "${firewall_nat_interface}" | \
grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
firewall_nat_flags="ip ${firewall_nat_interface} ${firewall_nat_flags}"
else
firewall_nat_flags="if ${firewall_nat_interface} ${firewall_nat_flags}"
fi
${fwcmd} nat 123 config log ${firewall_nat_flags}
${fwcmd} add 50 nat 123 ip4 from any to any via ${firewall_nat_interface}
fi
;;
esac
esac
############
# If you just configured ipfw in the kernel as a tool to solve network problems or you just want to disallow some particular kinds of traffic
# then you will want to change the default policy to open. You can also do this as your only action by setting the firewall_type to ``open''.
# ${fwcmd} add 65000 pass all from any to any
# Prototype setups.
case ${firewall_type} in
[Cc][Uu][Ss][Tt][Oo][Mm])
bruteblock_table="1"
nat_table="2"
is74_table="3"
# veres_gw_table="3"
src_route_table="4"
dst_route_table="5"
dns_table="6"
obspamd_table="7"
vpn_access_table="8"
common_fib="0"
is74_fib="1"
sinterra_fib="2"
tcp_extra_services="ftp,isakmp,3128,ntp"
tcp_services="ssh,smtp,domain,http,pop3,https,smtps,pop3s"
tcp_wan_services="domain"
udp_extra_services="ntp,syslog,dhcps,dhcpc"
udp_services="domain"
udp_wan_services="domain"
dhcp_services="dhcps,dhcpc"
local_services="dhcps,sunrpc,137-139,445,966,1281,3128-3131,12999"
dynamic_ports="1025-65535"
lo_net="127.0.0.0/8"
lan_if="lan0"
lan_ip="192.168.1.1"
lan_ip1="192.168.0.1"
lan_bc="192.168.1.255"
lan_net="192.168.0.0/23"
# lan_set=
wan0_if="is0"
wan0_gw="xx.xx.xx.x"
wan0_nat="124"
#wan_set=
pppoe_net="192.168.100.0/24"
is74_if="tun0"
is74_if="ng0"
is74_ip="xx.xx.x.x"
is74_gw="tun0:peer"
is74_gw="ng0:peer"
is74_nat="125"
# is74_set=
sinterra_if="sr0"
sinterra_ip="xx.xx.xx.xx"
sinterra_peer="xx.xx.xx.xx"
sinterra_gw="xx.xx.xx.xx"
sinterra_nat="126"
#sinterra_set=
trusted_hosts="$lo_net,$lan_net,$wan_net,$sinterra_peer"
# ${fwcmd} disable firewall
# ${fwcmd} enable one_pass
${fwcmd} disable one_pass
${fwcmd} enable dyn_keepalive
# ${fwcmd} disable dyn_keepalive
${fwcmd} nat $wan0_nat config if $wan0_if unreg_only same_ports
${fwcmd} nat $is74_nat config ip $is74_ip unreg_only same_ports
${fwcmd} nat $sinterra_nat config ip $sinterra_ip unreg_only same_ports
${fwcmd} table $src_route_table add $sinterra_ip $sinterra_gw
${fwcmd} table $nat_table add 192.168.0.4
${fwcmd} table $nat_table add 192.168.0.25
${fwcmd} table $nat_table add 192.168.1.25
${fwcmd} table $nat_table add 192.168.0.78
${fwcmd} table $nat_table add 192.168.0.111
${fwcmd} table $nat_table add 192.168.1.111
${fwcmd} table $nat_table add 192.168.0.21
${fwcmd} table $nat_table add 192.168.1.21
${fwcmd} table $is74_table add 192.168.0.80
${fwcmd} table $is74_table add 192.168.1.97
${fwcmd} table $is74_table add 192.168.1.99
${fwcmd} table $dns_table add 198.41.0.4
${fwcmd} table $dns_table add 192.228.79.201
${fwcmd} table $dns_table add 192.33.4.12
${fwcmd} table $dns_table add 128.8.10.90
${fwcmd} table $dns_table add 192.203.230.10
${fwcmd} table $dns_table add 192.5.5.241
${fwcmd} table $dns_table add 192.112.36.4
${fwcmd} table $dns_table add 128.63.2.53
${fwcmd} table $dns_table add 192.36.148.17
${fwcmd} table $dns_table add 192.58.128.30
${fwcmd} table $dns_table add 193.0.14.129
${fwcmd} table $dns_table add 199.7.83.42
${fwcmd} table $dns_table add 202.12.27.33
# ${fwcmd} table $dns_table add
# ${fwcmd} table $dns_table add
# ${fwcmd} table $dns_table add
# ${fwcmd} add 00001 allow tcp from any to $sinterra_ip 25 in via sr0 setup
# ${fwcmd} add 00002 allow tcp from any to $sinterra_ip 110 in via sr0 setup
# ${fwcmd} add 00003 allow tcp from any 25 to me
# ${fwcmd} add 00004 allow tcp from any 110 to me
${fwcmd} add 00010 nat $is74_nat tcp from 192.168.0.101 3389 to any xmit $is74_ip
${fwcmd} add 00011 skipto 50 tcp from 192.168.0.101 3389 to any xmit $is74_ip
${fwcmd} add 00012 nat $sinterra_nat tcp from 192.168.0.101 3389 to any xmit $sinterra_ip
${fwcmd} add 00013 skipto 50 tcp from 192.168.0.101 3389 to any xmit $sinterra_ip
${fwcmd} add 00020 nat $wan0_nat icmp from any to any recv $wan0_if
${fwcmd} add 00021 skipto 30 icmp from any to any recv $wan0_if
${fwcmd} add 00022 nat $wan0_nat tcp from any to me $dynamic_ports recv $wan0_if
${fwcmd} add 00023 nat $wan0_nat udp from any to me $dynamic_ports recv $wan0_if
${fwcmd} add 00024 nat $wan0_nat icmp from $lan_net to any xmit $wan0_if
${fwcmd} add 00025 skipto 30 icmp from $lan_net to any xmit $wan0_if
${fwcmd} add 00026 nat $wan0_nat ip4 from table\($nat_table\) $dynamic_ports to any xmit $wan0_if
${fwcmd} add 00027 nat $wan0_nat ip4 from table\($is74_table\) $dynamic_ports to any xmit $wan0_if
${fwcmd} add 00030 nat $is74_nat icmp from any to any recv $is74_ip
${fwcmd} add 00031 skipto 40 icmp from any to any recv $is74_ip
${fwcmd} add 00032 nat $is74_nat tcp from any to me $dynamic_ports recv $is74_ip
${fwcmd} add 00033 nat $is74_nat udp from any to me $dynamic_ports recv $is74_ip
${fwcmd} add 00034 nat $is74_nat icmp from $lan_net to any xmit $is74_ip
${fwcmd} add 00035 skipto 40 icmp from $lan_net to any xmit $is74_ip
${fwcmd} add 00036 nat $is74_nat ip4 from table\($nat_table\) $dynamic_ports to any xmit $is74_ip
${fwcmd} add 00037 nat $is74_nat ip4 from table\($is74_table\) $dynamic_ports to any xmit $is74_ip
${fwcmd} add 00040 nat $sinterra_nat icmp from any to any recv $sinterra_ip
${fwcmd} add 00041 skipto 50 icmp from any to any recv $sinterra_ip
${fwcmd} add 00042 nat $sinterra_nat tcp from any to me $dynamic_ports recv $sinterra_ip
${fwcmd} add 00043 nat $sinterra_nat udp from any to me $dynamic_ports recv $sinterra_ip
${fwcmd} add 00044 nat $sinterra_nat icmp from $lan_net to any xmit $sinterra_ip
${fwcmd} add 00045 skipto 50 icmp from $lan_net to any xmit $sinterra_ip
${fwcmd} add 00046 nat $sinterra_nat ip4 from table\($nat_table\) $dynamic_ports to any xmit $sinterra_ip
${fwcmd} add 00037 nat $is74_nat ip4 from $pppoe_net to any xmit $is74_ip
${fwcmd} add 00047 nat $sinterra_nat ip4 from $pppoe_net to any xmit $sinterra_ip
# ${fwcmd} add 00091 fwd 127.0.0.1,110 tcp from $lan_net to me 110
# ${fwcmd} add 00092 fwd 127.0.0.1,143 tcp from $lan_net to me 143
# ${fwcmd} add 00093 fwd 192.168.1.25 tcp from any to me 4662 recv $wan0_if
# ${fwcmd} add 00094 fwd 192.168.1.25 udp from any to me 4672 recv $wan0_if
# ${fwcmd} add 00095 fwd 127.0.0.1,25 tcp from me to $lan_net 25
# ${fwcmd} add 00096 allow tcp from any to $sinterra_ip 110 in via sr0 setup
# ${fwcmd} add 00097 allow tcp from any to $sinterra_ip 25 in via sr0 setup
# ${fwcmd} add 00098 allow tcp from any to any 25
# ${fwcmd} add 00099 allow tcp from any to any 110
${fwcmd} add 01100 pass ip4 from table\($nat_table\) to not me
${fwcmd} add 01200 pass ip4 from table\($is74_table\) to not me
${fwcmd} add 01300 pass ip4 from not me to table\($nat_table\)
${fwcmd} add 01400 pass ip4 from not me to table\($is74_table\)
${fwcmd} add 01500 allow tcp from 192.168.0.101 3389 to any
${fwcmd} add 01600 allow tcp from any to 192.168.0.101 3389
${fwcmd} add 02100 pass ip4 from me to $lan_net xmit $lan_if
${fwcmd} add 02200 pass ip4 from $lan_net to me recv $lan_if
${fwcmd} add 03100 pass ip4 from $lan_net to table\($dns_table\) 53
${fwcmd} add 03100 pass ip4 from table\($dns_table\) 53 to $lan_net
${fwcmd} add 03200 pass ip4 from $lan_net to $lan_net via $lan_if
${fwcmd} add 03300 deny ip4 from $lan_net to not me
${fwcmd} add 03400 deny ip4 from not me to $lan_net
${fwcmd} add 65000 pass ip4 from any to any
${fwcmd} add 65533 deny log ip4 from any to any
${fwcmd} add 65534 deny log all from any to any
;;
[Oo][Pp][Ee][Nn])
${fwcmd} add 65000 pass all from any to any
;;
[Cc][Ll][Ii][Ee][Nn][Tt])
############
# This is a prototype setup that will protect your system somewhat
# against people from outside your own network.
#
# Configuration:
# firewall_client_net: Network address of local network.
############
# set this to your local network
net="$firewall_client_net"
# Allow any traffic to or from my own net.
${fwcmd} add pass all from me to ${net}
${fwcmd} add pass all from ${net} to me
# Allow TCP through if setup succeeded
${fwcmd} add pass tcp from any to any established
# Allow IP fragments to pass through
${fwcmd} add pass all from any to any frag
# Allow setup of incoming email
${fwcmd} add pass tcp from any to me 25 setup
# Allow setup of outgoing TCP connections only
${fwcmd} add pass tcp from me to any setup
# Disallow setup of all other TCP connections
${fwcmd} add deny tcp from any to any setup
# Allow DNS queries out in the world
${fwcmd} add pass udp from me to any 53 keep-state
# Allow NTP queries out in the world
${fwcmd} add pass udp from me to any 123 keep-state
# Everything else is denied by default, unless the
# IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel
# config file.
;;
[Ss][Ii][Mm][Pp][Ll][Ee])
############
# This is a prototype setup for a simple firewall. Configure this
# machine as a DNS and NTP server, and point all the machines
# on the inside at this machine for those services.
#
# Configuration:
# firewall_simple_iif: Inside network interface.
# firewall_simple_inet: Inside network address.
# firewall_simple_oif: Outside network interface.
# firewall_simple_onet: Outside network address.
############
# set these to your outside interface network
oif="$firewall_simple_oif"
onet="$firewall_simple_onet"
# set these to your inside interface network
iif="$firewall_simple_iif"
inet="$firewall_simple_inet"
# Stop spoofing
${fwcmd} add deny all from ${inet} to any in via ${oif}
${fwcmd} add deny all from ${onet} to any in via ${iif}
# Stop RFC1918 nets on the outside interface
${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif}
${fwcmd} add deny all from any to 172.16.0.0/12 via ${oif}
${fwcmd} add deny all from any to 192.168.0.0/16 via ${oif}
# Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
# on the outside interface
${fwcmd} add deny all from any to 0.0.0.0/8 via ${oif}
${fwcmd} add deny all from any to 169.254.0.0/16 via ${oif}
${fwcmd} add deny all from any to 192.0.2.0/24 via ${oif}
${fwcmd} add deny all from any to 224.0.0.0/4 via ${oif}
${fwcmd} add deny all from any to 240.0.0.0/4 via ${oif}
# Network Address Translation. This rule is placed here deliberately
# so that it does not interfere with the surrounding address-checking
# rules. If for example one of your internal LAN machines had its IP
# address set to 192.0.2.1 then an incoming packet for it after being
# translated by natd(8) would match the `deny' rule above. Similarly
# an outgoing packet originated from it before being translated would
# match the `deny' rule below.
case ${natd_enable} in
[Yy][Ee][Ss])
if [ -n "${natd_interface}" ]; then
${fwcmd} add divert natd all from any to any via ${natd_interface}
fi
;;
esac
# Stop RFC1918 nets on the outside interface
${fwcmd} add deny all from 10.0.0.0/8 to any via ${oif}
${fwcmd} add deny all from 172.16.0.0/12 to any via ${oif}
${fwcmd} add deny all from 192.168.0.0/16 to any via ${oif}
# Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
# on the outside interface
${fwcmd} add deny all from 0.0.0.0/8 to any via ${oif}
${fwcmd} add deny all from 169.254.0.0/16 to any via ${oif}
${fwcmd} add deny all from 192.0.2.0/24 to any via ${oif}
${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif}
${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif}
# Allow TCP through if setup succeeded
${fwcmd} add pass tcp from any to any established
# Allow IP fragments to pass through
${fwcmd} add pass all from any to any frag
# Allow setup of incoming email
${fwcmd} add pass tcp from any to me 25 setup
# Allow access to our DNS
${fwcmd} add pass tcp from any to me 53 setup
${fwcmd} add pass udp from any to me 53
${fwcmd} add pass udp from me 53 to any
# Allow access to our WWW
${fwcmd} add pass tcp from any to me 80 setup
# Reject&Log all setup of incoming connections from the outside
${fwcmd} add deny log tcp from any to any in via ${oif} setup
# Allow setup of any other TCP connection
${fwcmd} add pass tcp from any to any setup
# Allow DNS queries out in the world
${fwcmd} add pass udp from me to any 53 keep-state
# Allow NTP queries out in the world
${fwcmd} add pass udp from me to any 123 keep-state
# Everything else is denied by default, unless the
# IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel
# config file.
;;
[Ww][Oo][Rr][Kk][Ss][Tt][Aa][Tt][Ii][Oo][Nn])
# Configuration:
# firewall_myservices: List of TCP ports on which this host
# offers services.
# firewall_allowservices: List of IPs which has access to
# $firewall_myservices.
# firewall_trusted: List of IPs which has full access
# to this host. Be very carefull
# when setting this. This option can
# seriously degrade the level of
# protection provided by the firewall.
# firewall_logdeny: Boolean (YES/NO) specifying if the
# default denied packets should be
# logged (in /var/log/security).
# firewall_nologports: List of TCP/UDP ports for which
# denied incomming packets are not
# logged.
# Allow packets for which a state has been built.
${fwcmd} add check-state
# For services permitted below.
${fwcmd} add pass tcp from me to any established
# Allow any connection out, adding state for each.
${fwcmd} add pass tcp from me to any setup keep-state
${fwcmd} add pass udp from me to any keep-state
${fwcmd} add pass icmp from me to any keep-state
# Allow DHCP.
${fwcmd} add pass udp from 0.0.0.0 68 to 255.255.255.255 67 out
${fwcmd} add pass udp from any 67 to me 68 in
${fwcmd} add pass udp from any 67 to 255.255.255.255 68 in
# Some servers will ping the IP while trying to decide if it's
# still in use.
${fwcmd} add pass icmp from any to any icmptype 8
# Allow "mandatory" ICMP in.
${fwcmd} add pass icmp from any to any icmptype 3,4,11
# Add permits for this workstations published services below
# Only IPs and nets in firewall_allowservices is allowed in.
# If you really wish to let anyone use services on your
# workstation, then set "firewall_allowservices='any'" in /etc/rc.conf
#
# Note: We don't use keep-state as that would allow DoS of
# our statetable.
# You can add 'keep-state' to the lines for slightly
# better performance if you fell that DoS of your
# workstation won't be a problem.
#
for i in ${firewall_allowservices}; do
for j in ${firewall_myservices}; do
${fwcmd} add pass tcp from $i to me $j
done
done
# Allow all connections from trusted IPs.
# Playing with the content of firewall_trusted could seriously
# degrade the level of protection provided by the firewall.
for i in ${firewall_trusted}; do
${fwcmd} add pass ip from $i to me
done
${fwcmd} add 65000 count ip from any to any
# Drop packets to ports where we don't want logging
for i in ${firewall_nologports}; do
${fwcmd} add deny { tcp or udp } from any to any $i in
done
# Broadcasts and muticasts
${fwcmd} add deny ip from any to 255.255.255.255
${fwcmd} add deny ip from any to 224.0.0.0/24 in # XXX
# Noise from routers
${fwcmd} add deny udp from any to any 520 in
# Noise from webbrowsing. The statefull filter is a bit agressive, and will cause some connection teardowns to be logged.
${fwcmd} add deny tcp from any 80,443 to any 1024-65535 in
# Deny and (if wanted) log the rest unconditionally.
log=""
if [ ${firewall_logdeny:-x} = "YES" -o ${firewall_logdeny:-x} = "yes" ]; then
log="log logamount 500" # The default of 100 is too low.
sysctl net.inet.ip.fw.verbose=1 >/dev/null
fi
${fwcmd} add deny $log ip from any to any
;;
[Cc][Ll][Oo][Ss][Ee][Dd])
${fwcmd} add 65000 deny ip from any to any
;;
[Uu][Nn][Kk][Nn][Oo][Ww][Nn])
;;
*)
if [ -r "${firewall_type}" ]; then
${fwcmd} ${firewall_flags} ${firewall_type}
fi
;;
esac
Код: Выделить всё
# ${fwcmd} add 00001 allow tcp from any to $sinterra_ip 25 in via sr0 setup
# ${fwcmd} add 00002 allow tcp from any to $sinterra_ip 110 in via sr0 setup
# ${fwcmd} add 00003 allow tcp from any 25 to me
# ${fwcmd} add 00004 allow tcp from any 110 to me