LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-10-2006, 11:07 AM   #1
ilan1
LQ Newbie
 
Registered: Jan 2006
Posts: 18

Rep: Reputation: 0
Question about IPtables/firewall rules


I was wondering if there was an easy command I could type
as root on Knoppix so that all TCP/IP traffic was forced
to go to only one or two domains.

Basically, I just want to setup a machine so that I could
leave a web browser open and that everybody who uses the
machine is forced to only go to just one or two websites.

Could somebody clue me in?

Thank you.

Ilan
 
Old 02-10-2006, 12:02 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by ilan1
I was wondering if there was an easy command I could type
as root on Knoppix so that all TCP/IP traffic was forced
to go to only one or two domains.
something like this should work:
Code:
iptables -I OUTPUT -p TCP -d ! xxx.xxx.xxx.xxx -j REJECT
repeat as necessary for each ip address you want to be allowed... you can also use a domain name (such as cnn.com, for example) but:

Quote:
Originally Posted by ilan1
Basically, I just want to setup a machine so that I could
leave a web browser open and that everybody who uses the
machine is forced to only go to just one or two websites.
this kinda thing is better done with a proxy server, unless you are 100% positive the IP address of the two websites will not change...

Last edited by win32sux; 02-10-2006 at 12:47 PM.
 
Old 02-20-2006, 01:36 PM   #3
ilan1
LQ Newbie
 
Registered: Jan 2006
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by win32sux
something like this should work:
Code:
iptables -I OUTPUT -p TCP -d ! xxx.xxx.xxx.xxx -j REJECT
repeat as necessary for each ip address you want to be allowed... you can also use a domain name (such as cnn.com, for example) but:

this kinda thing is better done with a proxy server, unless you are 100% positive the IP address of the two websites will not change...
I have tried this and set xxx.xxx.xxx.xxx to be the IP
address of a proxy server I was using and the iptables
command seems to work.

When I tried to visit another site, the browser would just
hang. Is there anyway to make it so that rather than timeouts
happening, that the connection drops are immediate? i.e. the
browser is more responsive?

I would prefer that it be obvious to the user that only one
or two websites are accessible and nothing else is accessible.

Thank you.
 
Old 02-20-2006, 11:58 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by ilan1
I have tried this and set xxx.xxx.xxx.xxx to be the IP
address of a proxy server I was using and the iptables
command seems to work.

When I tried to visit another site, the browser would just
hang. Is there anyway to make it so that rather than timeouts
happening, that the connection drops are immediate? i.e. the
browser is more responsive?

I would prefer that it be obvious to the user that only one
or two websites are accessible and nothing else is accessible.

Thank you.
i'm not sure i understand what you did with the iptables and the proxy, but the REJECT target should in fact send a "connection denied" (or whatever it's called) back to the client right away...

perhaps you need to edit your proxy's config?? well, like i said, i'm not sure i understand what you did...
 
  


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
Problem Iptables, Firewall rules. Can anybody help ? ZliTroX Linux - Networking 9 09-06-2004 04:48 PM
iptables firewall rules not surviving reboot BurceB7 Linux - Newbie 3 03-11-2004 11:45 AM
Suse firewall and custom iptables rules guerilla fighta Linux - Software 1 01-05-2003 07:44 AM
Firewall Rules Problem with Iptables JereBear Linux - Networking 1 06-16-2002 04:28 PM
Firewall Rules for daemons (Iptables) robeb Linux - Security 5 05-31-2002 04:27 PM

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

All times are GMT -5. The time now is 09:39 PM.

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