Toon posts:

FreeBDS IPFilter rules en logging

Pagina: 1
Acties:

Verwijderd

Topicstarter
Hoi anonymous,

Ik heb het volgende probleempje met het maken van een IPF rule.

Netwerk:
Nic1 inet ip
Nic2 intern 10Mb ip smb .
Nic3 intern 100Mb ip smb

De 2 interne segmenten moeten met elkaar communiceren zonder hinder van IPF rules op de router.
De wens is bepaald verkeer dat door Nic1 gaat te blokken ongeacht, dit kan zijn out, in of beide, op poort of/en ip.

Bv.
Ik wil smb verkeer naar buiten nic1 blokken maar intern nic2 & nic3 toestaan, ook smb verkeer van inet naar binnen wil ik toestaan, maar niet terug.

Dit werkt niet!?!

# block netbios stuf 2 inet
block out quick on nic1 proto tcp/udp from any to any port 135 >< 140
# block client 2 use proxy server
block out quick on nic1 proto tcp/udp from any to 222.15.150.54 port = 8080
block in quick on nic1 proto tcp/udp from any to 222.15.150.54 port = 8080


Dit werkt wel maar is niet de bedoeling:

block in quick on nic2 proto tcp/udp from any to any port 135 >< 140
block in quick on nic3 proto tcp/udp from any to any port 135 >< 140



|:( BVD aan de mensen die een bijdrage willen leveren,
Grtx Conar,


Verder nog een onduidelijkheid met het loggen van ip verkeer.
bv, " block in log level local0.info quick on ed2 all with opt lsrr "
Ik wil graag ergens kunnen terug vinden wat die log entries betekenen die zo keurig bijgehouden worden. Of een howto van log options en wat je het beste kan doen of instellen. Ik heb zelf ipfilter howto VAN Fri Apr 20 09:31:14 EDT 2001 gelezen.

Verwijderd

ipmon (das een programmatje)

daar zie je de gelogde packets.

mits je ipfilter_log in je kernel heb staan.

de rest behandel ik zo ff geen tijd.

Verwijderd

Topicstarter
Ik heb de boel wel aan het draaien met ipnat ipmon en ipf.

ipmon captured in /var/log/firewall.log
ipf is default_deny en met log optie in de kernel gecompileerd,

dus opzich zit dat wel goed 8-) alleen wil ik graag meer weten en kunnen dan dat nu het geval is met mijn staandaard opzetje!

Verwijderd

Topicstarter
Sebatech, ben je nog daar? :'(

Verwijderd

Sorry was heel het topic vergeten.

Waarom wil je smb verkeer trouwens toestaan om de binnen komende interface(internet??).

Dus jij wil het uitgaande netbios verkeer blokken? block out quick on nic1 from any to any port 135><140 dat werkt niet? hmm vreemd dat is een rule die ik zelf gebruik en gewoon werkt.

Verwijderd

3.7. Fancy Logging Techniques

It is important to note that the presence of the log
keyword only ensures that the packet will be available to
the ipfilter logging device; /dev/ipl. In order to actu-
ally see this log information, one must be running the ipmon
utility (or some other utility that reads from /dev/ipl).
The typical usage of log is coupled with ipmon -s to log the
information to syslog. As of ipfilter 3.3, one can now even
control the logging behavior of syslog by using log level
keywords, as in rules such as this:

block in log level auth.info quick on tun0 from 20.20.20.0/24 to any
block in log level auth.alert quick on tun0 proto tcp from any to 20.20.20.0/24 port = 21

In addition to this, you can tailor what information is
being logged. For example, you may not be interested that
someone attempted to probe your telnet port 500 times, but
you are interested that they probed you once. You can use
the log first keyword to only log the first example of a
packet. Of course, the notion of "first-ness" only applies
to packets in a specific session, and for the typical
blocked packet, you will be hard pressed to encounter situa-
tions where this does what you expect. However, if used in
conjunction with pass and keep state, this can be a valuable
keyword for keeping tabs on traffic.

Another useful thing you can do with the logs is to
keep track of interesting pieces of the packet in addition
to the header information normally being logged. Ipfilter
will give you the first 128 bytes of the packet if you use
the log body keyword. You should limit the use of body logging, as it makes your logs very verbose, but for certain
applications, it is often handy to be able to go back and
take a look at the packet, or to send this data to another
application that can examine it further.

Verwijderd

Topicstarter
[qwote]
Waarom wil je smb verkeer trouwens toestaan om de binnen komende interface(internet??).
[/qwote]

Ik wil in 1e instantie mijn "vervuiling" binnen mij eigen netwerk houden, later pas de rest.

[qwote]
hmm vreemd dat is een rule die ik zelf gebruik en gewoon werkt.
[/qwote]

Dacht ik dus ook...

Hier mij ipf.rules dan maar misschien dat je iets kan vinden?
#################################################################
# Out Interface
#################################################################
block in quick on nic1 from 192.168.0.0/16 to any # my private range
block out quick on nic1 proto tcp/udp from any to any port 135 >< 140 # netbios stuff
block out quick on nic1 proto tcp/udp from any to $proxy port = 8080 # a faulty proxy

# block in en log-info
block return-rst in log level local0.info quick on nic1 proto tcp from any to any #
block return-icmp-as-dest(port-unr) in quick on nic1 proto udp from any to any #
block in log level local0.info quick on nic1 all #

# block out en keep state
pass out quick on nic1 proto tcp from any to any keep state
pass out quick on nic1 proto udp from any to any keep state
pass out quick on nic1 proto icmp from any to any keep state
block out quick on nic1 all

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

pass out quick on nic3 proto tcp from any to any keep state
pass out quick on nic3 proto udp from any to any keep state
pass out quick on nic3 proto icmp from any to any keep state
block out quick on nic3 all


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

pass in quick on nic3 proto tcp from any to any keep state
pass in quick on nic3 proto udp from any to any keep state
pass in quick on nic3 proto icmp from any to any keep state
block in quick on nic3 all

l8ter Conar,
Pagina: 1