Настройки
Код: Выделить всё
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
ether f8:d1:11:02:90:6a
inet 10.214.180.3 netmask 0xffffff00 broadcast 10.214.180.63
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
ether 00:19:5b:3e:71:10
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
Код: Выделить всё
#!/bin/sh
#############################################
#**************** FireWall *****************#
#############################################
FwCMD="/sbin/ipfw "
FwTable="${FwCMD} table "
FwPipe="${FwCMD} pipe "
SysCTL="/sbin/sysctl "
SetFIB="/usr/sbin/setfib "
Route="/sbin/route "
#############################################
echo "Enable gateway"
${SysCTL} net.inet.ip.forwarding=1
${SysCTL} net.inet.ip.fastforwarding=1
echo "Disable one_pass"
${FwCMD} disable one_pass
echo "Disable debug"
${FwCMD} disable debug
echo "Set rule step to 1"
${SysCTL} net.inet.ip.fw.autoinc_step=1
NetOut_ISP="10.214.180.0/26"
IP_ISP="10.214.180.3"
LanOut_ISP="re0"
GW_ISP="10.214.180.1"
${Route} add default ${GW_ISP}
NetIn="192.168.0.0/24"
IpIn="192.168.0.1"
LanIn="re1"
TCP="20,ftp"
UDP="domain,ntp"
${FwCMD} -f flush
${FwCMD} -f pipe flush
${FwCMD} -f queue flush
${FwCMD} -f sched flush
${FwCMD} nat 1 config ip ${IP_ISP} unreg_only same_ports reset log \
redirect_port tcp 192.168.0.249:8000 8000 \
redirect_port udp 192.168.0.253:9987-9990 9987-9990 \
redirect_port tcp 192.168.0.253:30033 30033 \
redirect_port tcp 192.168.0.253:10011 10011 \
redirect_port tcp 192.168.0.254:64738 64738 \
redirect_port udp 192.168.0.254:64738 64738 \
redirect_port tcp 192.168.0.250:80 80 \
redirect_port tcp 192.168.0.250:443 443 \
redirect_port udp 192.168.0.252:53 53 \
redirect_port tcp 192.168.0.252:953 953 \
redirect_port tcp 192.168.0.252:53 53
${FwCMD} add 1 reass ip from any to any in
${FwCMD} add 2 deny icmp from any to any frag
${FwCMD} add 3 deny icmp from any to any in icmptypes 5,9,13,14,15,16,17
${FwCMD} add 4 deny ip from any to any dst-ip me ipoptions ssrr,lsrr,rr,ts
${FwCMD} add 5 reject tcp from any to any { tcpflags syn,fin,ack,psh,rst,urg or tcpflags !syn,!fin,!ack,!psh,!rst,!urg }
${FwCMD} add 6 reject tcp from any to any not established tcpflags fin
${FwCMD} add 100 skipto 10000 ip from any to any in via lo0
${FwCMD} add 101 skipto 15000 ip from any to any out via lo0
${FwCMD} add 102 skipto 20000 ip from any to any in via re0
${FwCMD} add 103 skipto 25000 ip from any to any out via re0
${FwCMD} add 104 skipto 30000 ip from any to any in via re1
${FwCMD} add 105 skipto 35000 ip from any to any out via re1
${FwCMD} add 10000 count ip from any to any in
${FwCMD} add 10001 allow ip from any to any in
${FwCMD} add 15000 count ip from any to any out
${FwCMD} add 15001 allow ip from any to any out
${FwCMD} add 20000 count ip from any to any in
${FwCMD} add 20001 skipto 65533 ip from table\(1\) to any in
${FwCMD} add 20002 nat 1 log ip from any to any in
${FwCMD} add 24999 allow ip from any to any in
${FwCMD} add 25000 count ip from any to any out
${FwCMD} add 25001 skipto 65533 ip from any to table\(1\) out
${FwCMD} add 25002 nat 1 log ip from ${NetIn} to any out
${FwCMD} add 29999 allow ip from any to any out
${FwCMD} add 30000 count ip from any to any in
${FwCMD} add 34999 allow ip from any to any in
${FwCMD} add 35000 count ip from any to any out
${FwCMD} add 39999 allow ip from any to any out
${FwCMD} add 65533 deny ip from any to any
${FwCMD} add 65534 allow ip from any to any

Кто сталкивался?
П.С. Еще вспомнил - на этой карте re1 (встроенная в материнку) если сменить мак - то карта его запоминает навсегда!!!!
