Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jun 2005 12:14:02 -0400
From:      "Paul Dufresne" <dufresnep@fastmail.fm>
To:        "Dmitry Mityugov" <dmitry.mityugov@gmail.com>
Cc:        dk dkrules <dkrules7@hotmail.com>, "P.U.Kruppa" <root@pukruppa.de>, freebsd-questions@freebsd.org
Subject:   Re: Setting a simple firewall for PPPoE connection
Message-ID:  <1118679242.23052.236254968@webmail.messagingengine.com>
In-Reply-To: <b7052e1e050611235422a4c233@mail.gmail.com>
References:  <BAY21-F20031309C5747F0945F69F8AFC0@phx.gbl> <20050609181128.G48525@www.pukruppa.net> <1118551395.29106.236171214@webmail.messagingengine.com> <b7052e1e050611235422a4c233@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--_----------=_1118679242230520
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="windows-1252"
MIME-Version: 1.0
X-Mailer: MIME::Lite 1.5  (F2.73; T1.001; A1.64; B3.05; Q3.03)
Date: Mon, 13 Jun 2005 16:14:02 UT



> Hopefully you'll find this link helpful:
> http://www.defcon1.org/html/Networking_Articles/Firewall-Ipfw/firewall-ipfw.html.
> 
> -- 
> Dmitry

yep, I did begin with that, but was not liking the fact that it was an
exclusive firewall (the end rule is to accept anything) rather than
an inclusive one.

I realized I could use "me" for my IP address (making it easy to write
rules even my ISP give me a dynamic IP address).

After reading it, looking at:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-ipfw.html
was not looking so strange anymore, and contain a good inclusive
example.

I did modify it a bit, mostly to accept FTP connections.
I realize this make much less secure, but I really like to use
FTP links in my browser.

I'll attach it to my message, so that wiser one than me could warn
me if I made something stupid.

I use /etc/rc.local to load the rules with a script containing:
sh /etc/ipfw.rules

Thanks for your help!

-- 
http://www.fastmail.fm - Send your email first class


--_----------=_1118679242230520
Content-Disposition: attachment; filename="ipfw.rules"
Content-Transfer-Encoding: base64
Content-Type: application/oct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VibGljCiMgSW50
ZXJuZXQgYXMgY2xlYXIgdGV4dC4KIyBEZWxldGUgdGhpcyBzYW1wbGUgZ3Jv
dXAgaWYgeW91IGRvIG5vdCBoYXZlIHRlbG5ldCBzZXJ2ZXIgZW5hYmxlZC4K
IyRjbWQgMDA0MjAgYWxsb3cgdGNwIGZyb20gYW55IHRvIG1lIDIzIGluIHZp
YSAkcGlmIHNldHVwIGxpbWl0IHNyYy1hZGRyIDIKCiMgUmVqZWN0ICYgTG9n
IGFsbCBpbmNvbWluZyBjb25uZWN0aW9ucyBmcm9tIHRoZSBvdXRzaWRlCiRj
bWQgMDA0OTkgZGVueSBsb2cgYWxsIGZyb20gYW55IHRvIGFueSBpbiB2aWEg
JHBpZgoKIyBFdmVyeXRoaW5nIGVsc2UgaXMgZGVuaWVkIGJ5IGRlZmF1bHQK
IyBkZW55IGFuZCBsb2cgYWxsIHBhY2tldHMgdGhhdCBmZWxsIHRocm91Z2gg
dG8gc2VlIHdoYXQgdGhleSBhcmUKJGNtZCAwMDk5OSBkZW55IGxvZyBhbGwg
ZnJvbSBhbnkgdG8gYW55CiMjIyMjIyMjIyMjIyMjIyMgRW5kIG9mIElQRlcg
cnVsZXMgZmlsZSAjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCg==

--_----------=_1118679242230520--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1118679242.23052.236254968>