[freebsd] must have ipfilter.rules

Pagina: 1
Acties:

  • wizl
  • Registratie: Maart 2001
  • Laatst online: 27-02-2023
'K heb nu FreeBSD draaien als router/firewall (en daar ben ik heel errrug blij mee, had eerst nl. wingate 3.0 :P)
Ik heb nu vgl. mij de meest standaard ipf.rules (block alles naar binnen, en laat alles naar buiten, grof gezegd).
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#################################################################
# Outside Interface 
#################################################################

#----------------------------------------------------------------
# Allow out all TCP, UDP, and ICMP traffic & keep state on it
# so that it's allowed back in.
#----------------------------------------------------------------
pass out quick on ed0 proto tcp from any to any keep state
pass out quick on ed0 proto udp from any to any keep state
pass out quick on ed0 proto icmp from any to any keep state
block out quick on ed0 all

#----------------------------------------------------------------
# Allow bootp traffic in from your ISP's DHCP server only. 
#----------------------------------------------------------------
pass in quick on ed0 proto udp from X.X.X.X/32 to any port = 68 keep state

#----------------------------------------------------------------
# Block and log all remaining traffic coming into the firewall
# - Block TCP with a RST (to make it appear as if the service 
# isn't listening)
# - Block UDP with an ICMP Port Unreachable (to make it appear 
# as if the service isn't listening)
# - Block all remaining traffic the good 'ol fashioned way
#----------------------------------------------------------------
block return-rst in log quick on ed0 proto tcp from any to any
block return-icmp-as-dest(port-unr) in log quick on ed0 proto udp from any to any
block in log quick on ed0 all 

################################################################# 
# Inside Interface 
################################################################# 

#---------------------------------------------------------------- 
# Allow out all TCP, UDP, and ICMP traffic & keep state 
#---------------------------------------------------------------- 
pass out quick on ed1 proto tcp from any to any keep state 
pass out quick on ed1 proto udp from any to any keep state 
pass out quick on ed1 proto icmp from any to any keep state 
block out quick on ed1 all 

#----------------------------------------------------------------
# Allow in all TCP, UDP, and ICMP traffic & keep state 
#---------------------------------------------------------------- 
pass in quick on ed1 proto tcp from any to any keep state 
pass in quick on ed1 proto udp from any to any keep state 
pass in quick on ed1 proto icmp from any to any keep state 
block in quick on ed1 all 

################################################################# 
# Loopback Interface 
################################################################# 

#---------------------------------------------------------------- 
# Allow everything to/from your loopback interface so you 
# can ping yourself (e.g. ping localhost) 
#---------------------------------------------------------------- 
pass in quick on lo0 all 
pass out quick on lo0 all

Wat zijn nu eigenlijk nog rules die je (als je het goed wilt doen) MOET toevoegen om andere rare aanvallen (DOS enzo) af te kunnen weren?

Verwijderd

Om rare aanvallen van D.O.S. packets te weren, moet je een kernel hebben met de volgende optie:
code:
1
options    ICMP_BANDLIM
ICMP_BANDLIM enables icmp error response bandwidth limiting. You typically want this option as it will help protect the machine from D.O.S. packet attacks.
Wat verdere handige rules zijn, die nog iets extra's kunnen bieden voor jou zou ik zo 1,2,3 ook niet weten.

  • xychix
  • Registratie: September 2000
  • Laatst online: 03-12-2025

xychix

FreeBSD Rules !

http://bsdfreaks.nl/main.php?page=messages&titleofpage=Ipfilter%20installeren%20op%20een%20Co-located%20machine%20!&ItemID=100

een door mij geschreven howto.

hier staat een leuke standaard ruleset in (het begin van de ruleset voorkomt spoofing ed.)

ik zal zelf nog eens achter dat icmp_bandwith aan!

ik zou zeggen kijk er eens na!

Every failure offers you a new opportunity! | Lokatie database|GoT - Notepad