opus
August 2nd, 2003, 23:37
WIll this work? None of this is mine, I just altered what I knew to do. Might even be a few things there that I have no clues as to what they are.
This is a gateway with the ip to the internet 192.168.1.10 and the inside ip 192.168.2.21
Thanks!
#
#
#Firewall rules 02AUG03
#
#
#
################################################## ##########################
#
#
#
#-------------------------
# Variables Section
#-------------------------
ext_if="dc0"
int_if="rl0"
#-------------------------------
# Non routable addresses
#-------------------------------
noroute="{10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 255.255.255.255/32, \
169.254.0.0/16, 127.0.0.0/8, 0.0.0.0/8, 192.0.2.0/24, \
204.152.64.0/23 127.0.0.0/8}"
#------------------------------
# Chat
#------------------------------
local_machines="{192.168.2.210, 192.168.2.230, 192.168.2.20, 192.168.2.240}"
#------------------------------
# Corporate Servers
#------------------------------
firewall="{192.168.1.10}"
webservers="{192.168.2.23}"
securewebservers="{192.168.2.23}"
mailservers="{192.168.2.23}"
ftpservers="{192.168.2.23}"
#------------------------------
# Hosting Services
#------------------------------
basic_services="{imap, pop3, smtp, www, https, ftp, ftp-data}"
#************************************************* ***********************
#************************************************* ***********************
# Firewall Rulebase Begin
#************************************************* ***********************
#************************************************* ***********************
#
#-----------------------------------------------------------------
# Packet Normalization (deny fragmented packets)
#-----------------------------------------------------------------
scrub in all
#------------------------------------
# Allow Loopback Packets
#------------------------------------
pass in quick on lo0 all
pass out quick on lo0 all
#
#-------------------------------------
# Allow from ext_if to int_if
#-------------------------------------
pass in quick on $ext_if to $int_if all
#---------------------------------
# Drop Spoofed Packets
#---------------------------------
block in quick from $noroute to any
#-------------------------------
# Drop wrong TCP Flags
#-------------------------------
block in quick on $ext_if inet proto tcp from any to any flags FUP/FUP
#-----------------------------------------
# Firewall RULES
#-----------------------------------------
# Always document what the rules are doing you don't know how long it will
# be before you look at them again
pass in quick on $ext_if proto tcp from any to $local_machines port {1863, 5050} flags S/SA modulate state
pass in quick on $ext_if proto tcp from any to $mailservers port {25, 143} flags S/SA modulate state
pass in quick on $ext_if proto tcp from any to $webservers port 80 flags S/SA modulate state
pass in quick on $ext_if proto tcp from any to $securewebservers port 443 flags S/SA modulate state
pass in quick on $ext_if proto udp from any to $nameservers port 53 keep state
#---------------------------------------------------
# FTP to webserver uncomment as needed
#---------------------------------------------------
pass in quick on $ext_if proto tcp from any to $ftpservers port {ftp, ftp-data} flags S/SA modulate state
#------------------------------
# Catch All Rule
#------------------------------
block in on $ext_if from any to any
#--------------------------------------------------------------
# Allow return traffic and connection from firewall
#--------------------------------------------------------------
pass out on $ext_if from any to any keep state
pass out on $int_if from any to any keep state
pass out on $host1_if from any to any keep state
This is a gateway with the ip to the internet 192.168.1.10 and the inside ip 192.168.2.21
Thanks!
#
#
#Firewall rules 02AUG03
#
#
#
################################################## ##########################
#
#
#
#-------------------------
# Variables Section
#-------------------------
ext_if="dc0"
int_if="rl0"
#-------------------------------
# Non routable addresses
#-------------------------------
noroute="{10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 255.255.255.255/32, \
169.254.0.0/16, 127.0.0.0/8, 0.0.0.0/8, 192.0.2.0/24, \
204.152.64.0/23 127.0.0.0/8}"
#------------------------------
# Chat
#------------------------------
local_machines="{192.168.2.210, 192.168.2.230, 192.168.2.20, 192.168.2.240}"
#------------------------------
# Corporate Servers
#------------------------------
firewall="{192.168.1.10}"
webservers="{192.168.2.23}"
securewebservers="{192.168.2.23}"
mailservers="{192.168.2.23}"
ftpservers="{192.168.2.23}"
#------------------------------
# Hosting Services
#------------------------------
basic_services="{imap, pop3, smtp, www, https, ftp, ftp-data}"
#************************************************* ***********************
#************************************************* ***********************
# Firewall Rulebase Begin
#************************************************* ***********************
#************************************************* ***********************
#
#-----------------------------------------------------------------
# Packet Normalization (deny fragmented packets)
#-----------------------------------------------------------------
scrub in all
#------------------------------------
# Allow Loopback Packets
#------------------------------------
pass in quick on lo0 all
pass out quick on lo0 all
#
#-------------------------------------
# Allow from ext_if to int_if
#-------------------------------------
pass in quick on $ext_if to $int_if all
#---------------------------------
# Drop Spoofed Packets
#---------------------------------
block in quick from $noroute to any
#-------------------------------
# Drop wrong TCP Flags
#-------------------------------
block in quick on $ext_if inet proto tcp from any to any flags FUP/FUP
#-----------------------------------------
# Firewall RULES
#-----------------------------------------
# Always document what the rules are doing you don't know how long it will
# be before you look at them again
pass in quick on $ext_if proto tcp from any to $local_machines port {1863, 5050} flags S/SA modulate state
pass in quick on $ext_if proto tcp from any to $mailservers port {25, 143} flags S/SA modulate state
pass in quick on $ext_if proto tcp from any to $webservers port 80 flags S/SA modulate state
pass in quick on $ext_if proto tcp from any to $securewebservers port 443 flags S/SA modulate state
pass in quick on $ext_if proto udp from any to $nameservers port 53 keep state
#---------------------------------------------------
# FTP to webserver uncomment as needed
#---------------------------------------------------
pass in quick on $ext_if proto tcp from any to $ftpservers port {ftp, ftp-data} flags S/SA modulate state
#------------------------------
# Catch All Rule
#------------------------------
block in on $ext_if from any to any
#--------------------------------------------------------------
# Allow return traffic and connection from firewall
#--------------------------------------------------------------
pass out on $ext_if from any to any keep state
pass out on $int_if from any to any keep state
pass out on $host1_if from any to any keep state