da54 [Solved] [IPF] Rules just don't work for me - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Firewalls

Firewalls IPFW, PF, IPF (but not limited) related discussion

Reply
 
Thread Tools Display Modes
  #1  
Old April 29th, 2012, 07:20
thefueley thefueley is offline
Junior Member
 
Join Date: Apr 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default [IPF] Rules just don't work for me

I have a simple ipf.rules setup. My interface is fxp0 but when I have that in my config file, it blocks everything. I can't ping or shell in.

Code:
pass in quick on lo0 all
pass out quick on lo0 all

pass out quick on fxp0 proto udp from any to 10.10.10.1 port = 53 keep state
pass out log quick on fxp0 proto udp from any to any port = 67 keep state
pass in quick on fxp0 proto icmp from any to any icmp-type 8 keep state
pass in quick on fxp0 proto tcp from any to any port = 22 flags S keep state

block in log first quick on fxp0 all
block out log first quick on fxp0 all
So I tried to fix it by changing the fxp0 part to any. I was able to login but I noticed that it wasn't reflecting my successful logins (ssh) in ipfstat -ih. I changed the ping and ssh rules to block instead. They didn't block. So as far as I can tell, the any part for the interface really did nothing for me except allow everything in. Any ideas?

Last edited by DutchDaemon; May 7th, 2012 at 15:37. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #2  
Old May 5th, 2012, 13:45
fbsd1 fbsd1 is offline
Member
 
Join Date: Feb 2010
Location: Angeles City, Philippines
Posts: 199
Thanks: 0
Thanked 42 Times in 28 Posts
Default

Turn on the log function and you will see [bad in] error message on each packet. FreeBSD release version 7.x through 9.0 are all running ipfilter version 4.1.28. This version of ipfilter has a known bug [since 2009] with interfaces that use a hardware checksum function. It seems that motherboards with builtin NICs come with the hardware checksum function enabled. Issue this command from the command line to disable the hardware checksum function: ifconfig fxp0 -rxcsum and your problem will go away.
__________________
FreeBSD Install Guide www.a1poweruser.com
Maintainer of the sysutils/qjail port

Last edited by DutchDaemon; May 6th, 2012 at 01:00.
Reply With Quote
The Following User Says Thank You to fbsd1 For This Useful Post:
thefueley (May 7th, 2012)
  #3  
Old May 5th, 2012, 16:08
aa aa is offline
Junior Member
 
Join Date: Mar 2012
Posts: 47
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Well.. that such a knowledge
How come it passed out RELEASE unnoticed?
Reply With Quote
  #4  
Old May 6th, 2012, 14:21
fbsd1 fbsd1 is offline
Member
 
Join Date: Feb 2010
Location: Angeles City, Philippines
Posts: 199
Thanks: 0
Thanked 42 Times in 28 Posts
Default

Ipfilter is not maintained by the FreeBSD development team. It's ported from an open source provider. Ipfilter is now at 5.1.1 version and FreeBSD still stays at version 4.1.28. I have posted PR's to get a current version imported into FreeBSD. But the PR is always closed before any real investigation is done about refreshing to a newer version. This subject never gets to the notice of the release team so nothing gets done to correct it. Send in your own pr and see what happens.
__________________
FreeBSD Install Guide www.a1poweruser.com
Maintainer of the sysutils/qjail port

Last edited by DutchDaemon; May 6th, 2012 at 21:30.
Reply With Quote
  #5  
Old May 7th, 2012, 01:34
thefueley thefueley is offline
Junior Member
 
Join Date: Apr 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

You are awesome! It did work for me. Is there a way to make the -rxcsum permanent? The setting disappears after a reboot.

Last edited by DutchDaemon; May 7th, 2012 at 15:36.
Reply With Quote
  #6  
Old May 7th, 2012, 01:43
thefueley thefueley is offline
Junior Member
 
Join Date: Apr 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Actually, I got it. I found it under the interfaces section, within sysinstall. Thank you again!

Last edited by DutchDaemon; May 7th, 2012 at 15:36.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[IPF] Regarding IPF rules shesjustaglitch Firewalls 1 April 2nd, 2012 06:38
[Solved] Network config don't work on FreeBSD but work on Ubuntu/Debian/OpenBSD; why ? zyzuz Networking 7 March 30th, 2012 19:07
my ipf rules rill Firewalls 2 October 18th, 2010 13:50
Are there any way to add new rules to pf without write the rules to the pf.conf tanakorn Firewalls 2 February 8th, 2010 09:09
[Solved] My first pf rules locutus Firewalls 6 October 13th, 2009 10:04


All times are GMT +1. The time now is 17:26.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0