LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices



Reply
 
Search this Thread
Old 06-20-2006, 10:23 AM   #1
gazman1
Member
 
Registered: Jan 2005
Posts: 40

Rep: Reputation: 15
ipfw


I have read the ipfw man page and find it difficult to understand, what I want to do is set up the firewall to allow ssh & ftp connections from only mypc123.com and mypc456.com and block and log everything else.

Last edited by gazman1; 06-20-2006 at 10:26 AM.
 
Old 06-21-2006, 03:46 AM   #2
Fredstar
Member
 
Registered: Jul 2004
Location: Rochester, NY
Distribution: Fedora9::FreeBSD7.1
Posts: 296

Rep: Reputation: 30
Quote:
Originally Posted by gazman1
I have read the ipfw man page and find it difficult to understand, what I want to do is set up the firewall to allow ssh & ftp connections from only mypc123.com and mypc456.com and block and log everything else.

Have you ever though of using PF-firewall?

As of now (net, free) both support openbsd's PF-Firewall which i believe to be more configurable.
 
Old 06-21-2006, 12:32 PM   #3
gazman1
Member
 
Registered: Jan 2005
Posts: 40

Original Poster
Rep: Reputation: 15
will pf-firewall run on os x?
 
Old 06-21-2006, 03:09 PM   #4
Fredstar
Member
 
Registered: Jul 2004
Location: Rochester, NY
Distribution: Fedora9::FreeBSD7.1
Posts: 296

Rep: Reputation: 30
Quote:
Originally Posted by gazman1
will pf-firewall run on os x?
Not that i know of. I would say google it and see what comes up.
 
Old 06-22-2006, 12:13 PM   #5
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 41
Quote:
Originally Posted by gazman1
I have read the ipfw man page and find it difficult to understand, what I want to do is set up the firewall to allow ssh & ftp connections from only mypc123.com and mypc456.com and block and log everything else.
The basic ipfw addition command looks something like this:
Code:
ipfw [ rulenum ] add ( allow | deny ) proto from address [ port ] to address [ port ] [ options ]
You can also use the shortcut phrase "me" to refer to any IP address on a local interface, which makes for more readable rules. The options refers to various extraneous options, the most popular of which is keep-state. This means that when the rule is evaluated for a connection, that evaluation is kept in memory as long as that connection persists. It's a bit of an optimization, in other words. Here's a ruleset that I think should do what you want:
Code:
add allow all from any to any via lo0
add allow tcp from mypc123.com, mypc456.com to me 22          # SSH
add allow tcp from me 22 to mypc123.com, mypc456.com          # SSH
add allow tcp from mypc123.com, mypc456.com to me 21          # FTP Control
add allow tcp from me 21 to mypc123.com, mypc456.com          # FTP Control
add allow tcp from me 1024-65535 to mypc123.com, mypc456.com  # Passive FTP Transfer
add deny log all from any to any
The basic ipfw delete command looks like:
Code:
ipfw rulenum delete
As a warning, there is one thing I'm uncertain about the above syntax. If you use a domain name instead of an IP address, you may need to have that domain name defined in /etc/hosts. Other than that, I'm pretty sure this will work as you requested.
 
Old 06-24-2006, 04:12 AM   #6
kdrlx
Member
 
Registered: Feb 2006
Distribution: Ubuntu Hardy Heron
Posts: 130

Rep: Reputation: 16
GUI way to configure ipfw

Instead of using any other firewall, I would recommend using IPFW. Its nice for what it does and you would find it compiled in the kernel with FreeBSD 6.x and I think with 5.x as well.

You can configure ipfw with the above post or you could also use the QTFW program which can be used to configure firewall rules.

Here's the link to the project page.
http://sourceforge.net/projects/qtfw/

A [ pkg_add -r qtfw ] should get you the package and all its dependencies as well.
 
Old 07-10-2006, 04:24 AM   #7
Gkarfield
Member
 
Registered: Jul 2004
Location: Greece
Distribution: FreeBSD 6.2/widows[not 8 legs nor black]
Posts: 123

Rep: Reputation: 15
what about ipf ? '/etc/ipf.rules'

[please dont put rules that dont work in this file, i did it, and after the reboot i was locked out of my pc ]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ipfw ruleset h9000 *BSD 2 04-10-2009 10:37 AM
portforwarding using ipfw thar Linux - Networking 1 08-15-2005 06:38 PM
using ipfw on a linux release ? xround *BSD 6 02-18-2005 06:39 AM
IPFW rules ryancoolest *BSD 5 02-19-2004 02:03 AM
Ipfw rule J_Szucs *BSD 1 05-03-2003 09:29 PM


All times are GMT -5. The time now is 11:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration