The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
Google UNIX.COM


IP Networking Questions involving TCP/IP, Routers, Hubs, Network protocols, etc go here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Firewall Box Tabryan07 UNIX for Dummies Questions & Answers 2 09-17-2007 06:22 AM
Ftp to firewall vtran4270 Linux 0 01-30-2004 05:20 PM
Looking Out from Behind a Firewall mntamago Security 4 07-17-2003 05:39 AM
What Firewall do you use? tarballed Security 5 08-07-2002 09:17 PM
ssh thru firewall thangorn UNIX for Dummies Questions & Answers 3 02-22-2002 03:24 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 12-28-2001
Registered User
 

Join Date: Dec 2001
Location: Houston, TX
Posts: 4
BSD Firewall

i am setting up a BSD firewall for the first time. I have recompiled the kernel and all that, but am having trouble building a good ruleset. I have read the manpages but am still having trouble creating what I need. It is either nothing is going through or everything is. Does anybody know of a decent tutorial on creating rulesets with ipfw?
Reply With Quote
Forum Sponsor
  #2  
Old 01-06-2002
Registered User
 

Join Date: Jan 2002
Location: Birmingham, AL
Posts: 2
I have been using fbsd for my personal firewall at home for years now. Here is what I filter.

Block ICMP for starters.

You'll also want to filter ports that you don't want the world to be connecting to, for instance ssh. Even though ssh is encrypted, I only allow connections to that port from my internal network and the IP addresses of friends and other networks that I use. I am anal though.

To see a list of what's open, run netstat -an | grep LISTEN. You have to find out what's running on your box before you can know what rulesets to create. If you're using X, then I'd filter that port as well. Obviously it's only going to show up in a netstat output when it's up.

I compiled and briefly looked at a program called qtfw in the ports collection. It's a GUI front end to ipfw, but I don't use it.

If you want to look more at what's going on with incoming connections, turn on "log_in_vain"

# sysctl -a | grep vain
net.inet.tcp.log_in_vain: 1
net.inet.udp.log_in_vain: 1

These will be set to 0 by default.

Also, on your ipfw rules that you create, setup logging on the more important ones. You can use "log logamount" in your ipfw rules to write connection attempts to filtered ports to /var/log/security.
__________________
Brian Byers
cbbyers@cbbyers.com
http://www.cbbyers.com
Reply With Quote
  #3  
Old 01-06-2002
Registered User
 

Join Date: Jan 2002
Location: Birmingham, AL
Posts: 2
I dug this URL up for you - http://www.onlamp.com/pub/a/bsd/2001...SD_Basics.html
__________________
Brian Byers
cbbyers@cbbyers.com
http://www.cbbyers.com
Reply With Quote
  #4  
Old 01-06-2002
Registered User
 

Join Date: Oct 2001
Location: Romania
Posts: 47
Thumbs up Re: BSD Firewall

If the BSD you are using is FreeBSD, then it is pretty simple to do that:
- edit your /etc/rc.conf and enable the firewall script at boot time: insert a line like this firewall_enable="YES", and specify a type of firewall from the ones FreeBSD already includes: firewall_type="Open"|"Client"|"Simple"|"Unknown" or define your own type.
- take a look at /etc/rc.firewall and edit this file to suit your needs. This file contains a sample firewall configuration and I reccomend it.

If you want to do something more: to have a network behind this firewall, it would be a good ideea to set the firewall type to "Simple" and change the options for network address, external interface ip address etc. And if you have only one IP address and want to make possible "masquerading" you must add two more lines to /etc/rc.conf: natd_enable="YES" and natd_interface="your_external_interface_name(i.e. xl0)". To have this option working [nat] you must configure your kernel to support IPDIVERT

For any other information regarding firewalls you may contact me

Quote:
Originally posted by deadletter
i am setting up a BSD firewall for the first time. I have recompiled the kernel and all that, but am having trouble building a good ruleset. I have read the manpages but am still having trouble creating what I need. It is either nothing is going through or everything is. Does anybody know of a decent tutorial on creating rulesets with ipfw?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0