# cat rc.firewall.run
#!/bin/sh -
#
FwCMD="/sbin/ipfw"
LanOut="tun0"
LanIn="vr0"
IpOut="10.159.38.242"
IpIn="192.168.2.1"
NetMask="24"
NetIn="192.168.2.0"
#
${FwCMD} -f flush
/sbin/ipfw add check-state
/sbin/ipfw add 180 divert 8668 ip from 192.168.2.0/24 to any out xmit ng0
/sbin/ipfw add 190 divert 8668 ip from any to 10.159.38.242
/sbin/ipfw add 200 divert 8669 ip from 192.168.2.0/24 to any out xmit ng1
/sbin/ipfw add 210 divert 8669 ip from any to 10.2.64.3
/sbin/ipfw add 500 allow ip from any to any via lo0
/sbin/ipfw add 600 allow ip from any to 192.168.2.0/24 in via vr0
/sbin/ipfw add 700 allow ip from 192.168.2.0/24 to any out via vr0
/sbin/ipfw add 800 allow icmp from any to any
/sbin/ipfw add 900 allow tcp from any to any established
/sbin/ipfw add 1100 allow tcp from any to any via vr0
/sbin/ipfw add 1200 allow udp from any to any via vr0
/sbin/ipfw add 1210 allow tcp from any to me dst-port 8085
/sbin/ipfw add 1220 allow tcp from any to me dst-port 3724
/sbin/ipfw add 55010 allow tcp from any to any dst-port 1024-65534
/sbin/ipfw add 55020 allow tcp from any 1024-65534 to any
/sbin/ipfw add 55050 allow udp from any to any dst-port 1024-65534
/sbin/ipfw add 55060 allow udp from any 1024-65534 to any
/sbin/ipfw add 65534 deny ip from any to any
#!/bin/sh -
#
FwCMD="/sbin/ipfw"
LanOut="tun0"
LanIn="vr0"
IpOut="10.159.38.242"
IpIn="192.168.2.1"
NetMask="24"
NetIn="192.168.2.0"
#
${FwCMD} -f flush
/sbin/ipfw add check-state
/sbin/ipfw add 180 divert 8668 ip from 192.168.2.0/24 to any out xmit ng0
/sbin/ipfw add 190 divert 8668 ip from any to 10.159.38.242
/sbin/ipfw add 200 divert 8669 ip from 192.168.2.0/24 to any out xmit ng1
/sbin/ipfw add 210 divert 8669 ip from any to 10.2.64.3
/sbin/ipfw add 500 allow ip from any to any via lo0
/sbin/ipfw add 600 allow ip from any to 192.168.2.0/24 in via vr0
/sbin/ipfw add 700 allow ip from 192.168.2.0/24 to any out via vr0
/sbin/ipfw add 800 allow icmp from any to any
/sbin/ipfw add 900 allow tcp from any to any established
/sbin/ipfw add 1100 allow tcp from any to any via vr0
/sbin/ipfw add 1200 allow udp from any to any via vr0
/sbin/ipfw add 1210 allow tcp from any to me dst-port 8085
/sbin/ipfw add 1220 allow tcp from any to me dst-port 3724
/sbin/ipfw add 55010 allow tcp from any to any dst-port 1024-65534
/sbin/ipfw add 55020 allow tcp from any 1024-65534 to any
/sbin/ipfw add 55050 allow udp from any to any dst-port 1024-65534
/sbin/ipfw add 55060 allow udp from any 1024-65534 to any
/sbin/ipfw add 65534 deny ip from any to any
Комментарии
Отправить комментарий