LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 11-04-2007, 06:11 AM   #1
anillohchab007
Member
 
Registered: Nov 2007
Location: Bangalore, India
Distribution: kubuntu Intrepid Ibex & debian etch & fedora sulphur & centos 5.3
Posts: 32

Rep: Reputation: 15
Unhappy Regarding Iptables


i am a system administrator in our lab(university deptt). Our server is also a client of our university main server.
We've a proxy server. So when we banned some sites in our lab people can still access them by using the proxy settings of university main server.

thats why we want to setup a transprent proxy so that people have to give proxy settings of our local server otherwise they cant access the net.

I cant able to setup firewall using iptables kind of stuff.

Can anybody help me on this:

Os : debain
kernel version : 2.6.8-1-686
Apache/2.0.52
Squid Cache: Version 2.5.STABLE6
iptables v1.2.9


pleeeeeeeeez
 
Old 11-04-2007, 08:30 AM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
I don't know if danguardian would be of any help.
So you are saying the clients change thier proxy setting from the labs proxy setting to the univeristy proxy settings and they can go anywhere.

The better option is to like you want is either build a linux router and set iptables not to connect to certain sites. You could possible place a router between all clients and the univeristy network. Some can define sites to block. But may not work based on univeristy proxy. using a simple linux router would be the better choice. You can configure the the univeristy side to the correct settings then setup lan side to non routable network class c like 192.168.1.0/24. Then use iptables to block sites. You can use a command like this to block based on IP
/sbin/iptables -A DST_EGRESS -d xxx.xxx.xxx.xxx -j DROP

Using domain name I am not sure. Kind of why proxy handles that better with danguardian.

Brian
 
Old 11-05-2007, 07:11 AM   #3
anillohchab007
Member
 
Registered: Nov 2007
Location: Bangalore, India
Distribution: kubuntu Intrepid Ibex & debian etch & fedora sulphur & centos 5.3
Posts: 32

Original Poster
Rep: Reputation: 15
@ Brian1

you say that try to use dansgaurdian but as i know
it blocks the sites by seeing a pattern in http request.
But the problem remain same as i think.
because as clients are directly giving the university main server proxy settings our local server doesnt see what actually it contains. So It simply forward that request to university main server which inturn doesnt block that sites.
So that thing i want to say that if any request comes to our local server from a client having proxy settings for university main server. It simply redirect it to "permission denied" page or something like. which can be done by using firewall(iptables or something like that).
But the question remain same HOWTO ?
as i googled a lot i cant find any good solution.

sorry if i misunderstand something what you are saying.
 
Old 11-05-2007, 11:00 AM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
A short term solution to stop them from connecting to the server:
Code:
iptables -I FORWARD -d $SERVER_IP -j REJECT
Replace $SERVER_IP with the IP of the server.
 
Old 11-06-2007, 01:25 AM   #5
anillohchab007
Member
 
Registered: Nov 2007
Location: Bangalore, India
Distribution: kubuntu Intrepid Ibex & debian etch & fedora sulphur & centos 5.3
Posts: 32

Original Poster
Rep: Reputation: 15
@ win32sux

thnx dude its working !
i do the same thing as you said .
I run the command :
iptables -I FORWARD -d $SERVER_IP -j REJECT

but i want a solution which work permanently.
As i think, if i put this command as my startup script than i think
it works what you say.

if you have any other permanent solution then please let me know.
 
Old 11-06-2007, 01:35 AM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by anillohchab007 View Post
thnx dude its working !
i do the same thing as you said .
I run the command :
iptables -I FORWARD -d $SERVER_IP -j REJECT

but i want a solution which work permanently.
As i think, if i put this command as my startup script than i think
it works what you say.

if you have any other permanent solution then please let me know.
Well, the permanent solution would be to implement the transparent proxy you mentioned, and firewall everything else. Even though this was only meant as a workaround for your current bypass issue, it's perfectly fine for you to add this to your startup scripts.
 
Old 11-06-2007, 06:29 AM   #7
anillohchab007
Member
 
Registered: Nov 2007
Location: Bangalore, India
Distribution: kubuntu Intrepid Ibex & debian etch & fedora sulphur & centos 5.3
Posts: 32

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by win32sux View Post
Well, the permanent solution would be to implement the transparent proxy you mentioned, and firewall everything else. Even though this was only meant as a workaround for your current bypass issue, it's perfectly fine for you to add this to your startup scripts.
You are saying that try to implement transparent proxy and firewalls etc.
but question again remain same HOWTO.
because i googled a lot on this topic but i cant find a reasonable solution. There are hell lot of documentation on this topic i tried some of them on our server(which i not supposed to). but no one can work properly. All of the commands given there(change to squid.conf,executing some iptables related commands etc.) are executed properly But No one can able to give me that result wat i want as your single command did.
So if you have any documentation related to this please let me know.

thnx for everything
 
  


Reply



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
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
Iptables - Couldn't load target `ACCPET':/lib/iptables/libipt_ACCPET.so: z00t Linux - Security 3 01-26-2004 02:24 AM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 06:08 AM
iptables book wich one can you pll recomment to be an iptables expert? linuxownt Linux - General 2 06-26-2003 04:38 PM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM

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

All times are GMT -5. The time now is 06:55 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