uname -a
FreeBSD serv 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Tue Sep 7 00:14:27 NOVST 2010 adm@serv:/usr/obj/usr/src/sys/mykern060910 amd64
Код: Выделить всё
######## NETWORK ###########
defaultrouter="10.59.0.1"
pf_enable="YES"
sshd_enable="YES"
pf_rules="/etc/pf.conf"
#apache22_enable="YES"
ifconfig_em1="DHCP"
#ifconfig_em1="inet 10.59.1.1 netmast 255.255.248.0"
ifconfig_em0="inet 192.168.1.1 netmask 255.255.0.0"
gateway_enable="YES"
hostname="serv"
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pfsync_enable="NO" # Expose pf state to other hosts for syncing
pfsync_syncdev="" # Interface for pfsync to work through
pfsync_syncpeer="" # IP address of pfsync peer host
pfsync_ifconfig=""
ftpproxy_enable="YES"
ftpproxy_flags="-D 0"
mpd_enable="YES"
#++++++++++++++++++++++++++++#
##############################
# Interfase #
##############################
keymap=ru.cp1251
scrnmap="win2cpp866"
font8x16=cp866-8x16
font8x14=cp866-8x14
font8x8=cp866-8x8
#++++++++++++++++++++++++++++#
##############################
# MySQL #
##############################
#mysql_enable="YES"
#mysql_limits="NO"
#mysql_dbdir="/var/db/mysql"
#mysql_args="--log"
#++++++++++++++++++++++++++++#
#############################
# FTP #
#############################
#pureftpd_enable=YES
#proftpd_enable=YES
#proftpd_flags="-n -d 5"
#+++++++++++++++++++++++++++#
#############################
# Misc Daemon #
#############################
accounting_enable="YES"
threeproxy_enable="YES"
#zeo3_enable=YES
#zeo3_instances=/usr/local/www/Zope3/
#+++++++++++++++++++++++++++#
############################
# rtorrent #
#rtorrent_enable="YES"
#rtorrent_scgi_port="127.0.0.1:5000"
#++++++++++++++++++++++++++#
#radd_enable="YES"
#linux_enable="YES"
#ejabberd_enable="YES"
###########################
# DNS #
#nsd_enable="YES"
#named_enable="YES"
#named_program="/usr/sbin/named"
#named_flags="-u bind -c /etc/namedb/named.conf"
synchronous_dhclient="YES"
#zabbix_agentd_enable="YES"
#zabbix_server_enable="YES"
Код: Выделить всё
########################################
int_if="em0"
ext_if="em1"
virt_if="ng0"
icmp_types="echoreq"
set block-policy return
set skip on lo
set loginterface $ext_if
scrub in
########################################
# show loging
# tcpdump -n -e -ttt -r /var/log/pflog
# real time
# tcpdump -n -e -ttt -i pflog0
# show statistic
# pfctl -s info
########################################
rdr on $virt_if proto { tcp, udp } from any to any port { 3460 23 } -> 192.168.1.4
rdr on $virt_if proto { tcp, udp } from any to any port { 5801 5901 5900 5902 5903 5904 5905 5905 5906 5907 5908 6881 } -> 192.168.1.2
#nat on $virt_if proto { tcp, udp } from 192.168.1.2 to any -> 85.21.245.15
nat inet from $int_if:network to $ext_if:network -> ($ext_if)
#### -> ...
#nat inet from $int_if:network to !(self) -> ($virt_if)
nat inet from $int_if:network to !(self) -> ($virt_if)
rdr-anchor "ftp-proxy/*"
rdr on $int_if proto tcp from any to !(self) port ftp -> 127.0.0.1 port 8021
rdr on $int_if proto { tcp, udp } from any to any port 23051 -> 192.169.1.2
anchor "ftp-proxy/*"
pass quick on $ext_if proto tcp from any port 31322
#block log all
pass on $int_if
pass out
# uncomment this strings for open "ping"
pass in inet proto icmp all icmp-type $icmp_types keep state
pass in proto udp from any to any port 33433 >< 33626 keep state
#pass all
Код: Выделить всё
[adm@serv~]> ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC>
ether 00:1b:21:53:7c:f8
inet 192.168.1.1 netmask 0xffff0000 broadcast 192.168.255.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
msk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=c011a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,VLAN_HWTSO,LINKSTATE>
ether 00:15:f2:0d:d2:fa
media: Ethernet autoselect
em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC>
ether 00:07:e9:5a:73:f4
media: Ethernet autoselect
status: no carrier
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet 127.0.0.1 netmask 0xff000000
pflog0: flags=100<PROMISC> metric 0 mtu 33152
pfsync0: flags=0<> metric 0 mtu 1460
syncpeer: 224.0.0.240 maxupd: 128
ng0: flags=8890<POINTOPOINT,NOARP,SIMPLEX,MULTICAST> metric 0 mtu 1500