LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-23-2006, 10:36 PM   #1
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 366
Blog Entries: 1

Rep: Reputation: 44
Home Router Firewall Setup


I have set up a linux box with to NICs to act as a router/DHCP server/firewall for my home network. It is connected to a cable modem on one interface (eth0), and to my home LAN on the other interface (eth1...via a switch), and sharing the internet connection with the LAN, using IP masquerading. I am using iptables as my firewall. The router's IP address is 192.168.0.1 on eth1.

1)I would like to allow internal computers and servers to be able to use bittorrent and browse web pages, but hear nothing else, besides what is required for that, from the outside world.
2)I would like to run a squid proxy on the router on port 3128, and pass all web page requests from the internal network through it.
3)I would like to block everything else. I will use port-knocking to open up any additional ports when they are needed. This includes not showing any other open ports on the server (like SSH) to internal computers, unless they knock on them to open them up.

What would my firewall setup script look like for something like this? How can I make sure to only allow the abovementioned types of traffic? What do I need in my FORWARD chain and nat table to make sure things are working properly with the IP masquerading? Anything important I should make sure is in my squid.conf file?

thanks,
jrtayloriv

Last edited by jrtayloriv; 12-23-2006 at 11:13 PM.
 
Old 12-24-2006, 01:53 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I found this lecture on net_filter. The last part is about port-knocking.
http://lion.cs.uiuc.edu/courses/cs49.../lecture13.ppt

Here is a LinuxJournal article on Port Knocking.
http://www.linuxjournal.com/article/6811

Last edited by jschiwal; 12-24-2006 at 03:14 AM.
 
Old 12-25-2006, 01:06 PM   #3
ScooterB
Member
 
Registered: Sep 2003
Location: NW Arkansas
Distribution: Linux Redhat 9.0, Fedora Core 2,Debian 3.0, Win 2K, Win95, Win98, WinXp Pro
Posts: 344

Rep: Reputation: 31
Cool

This link is one of the definitive resources on iptables. Take a look at it and if you need more assistance repost. http://iptables-tutorial.frozentux.n...-tutorial.html
 
Old 12-25-2006, 06:05 PM   #4
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 366

Original Poster
Blog Entries: 1

Rep: Reputation: 44
Thumbs up solved

The frozentux tutorial is exactly what I needed thanks.

-jrtayloriv
 
Old 12-25-2006, 06:19 PM   #5
ScooterB
Member
 
Registered: Sep 2003
Location: NW Arkansas
Distribution: Linux Redhat 9.0, Fedora Core 2,Debian 3.0, Win 2K, Win95, Win98, WinXp Pro
Posts: 344

Rep: Reputation: 31
You're quite welcome! Enjoy and good luck!
 
  


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
Home network setup with network firewall/router Gates1026 Linux - Networking 4 01-17-2005 08:26 PM
router and firewall setup jibskg Linux - Networking 1 08-23-2004 09:01 AM
router/firewall setup please help?! basatum Mandriva 1 09-20-2003 03:53 PM
3 subnet firewall router setup ivm Linux - Networking 0 08-11-2003 06:54 PM
How to Setup Firewall for home network julesbrat Linux - Networking 1 05-19-2002 03:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:11 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
Open Source Consulting | Domain Registration