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 09-18-2009, 06:10 PM   #1
Net_Spy
Member
 
Registered: Nov 2006
Posts: 119

Rep: Reputation: 17
blocking local webserver for internal clients


Greetings to All,
I've small issue with blocking local clients. I mean I've webserver that I want to allow limited number to clients to that let say I've 10 users from 10.5.1.1-10 I would like to block 1-9 and allow only last client to access that webserver .

Ive tried the following

Code:
iptables -A  -p tcp -i eth1 -d 10.1.1.14 -s ! 10.5.1.10  -j REJECT
iptables -A INPUT -p tcp -d 10.1.1.14 -i eth1 -s ! 10.5.1.10  -j DROP
Looling forward for your kind response.

Regards
Net_Spy
 
Old 09-18-2009, 06:31 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 Net_Spy View Post
I've small issue with blocking local clients. I mean I've webserver that I want to allow limited number to clients to that let say I've 10 users from 10.5.1.1-10 I would like to block 1-9 and allow only last client to access that webserver .

Ive tried the following

Code:
iptables -A  -p tcp -i eth1 -d 10.1.1.14 -s ! 10.5.1.10  -j REJECT
iptables -A INPUT -p tcp -d 10.1.1.14 -i eth1 -s ! 10.5.1.10  -j DROP
To allow packets to 10.1.1.14 from 10.5.1.10, while denying those from 10.5.1.1-9 you could do a:
Code:
iptables -I INPUT -i eth1 -d 10.1.1.14 -m iprange --src-range 10.5.1.1-10.5.1.9 -j REJECT
iptables -I INPUT -i eth1 -d 10.1.1.14 -s 10.5.1.10 -j ACCEPT
What happens to packets with other source IPs will depend on your INPUT policy (or any other rules).

To allow packets to 10.1.1.14 from 10.5.1.10, while denying all others you could do a:
Code:
iptables -I INPUT -i eth1 -d 10.1.1.14 -s ! 10.5.1.10 -j DROP
This would work regardless of the INPUT policy or any other rules.

Keep in mind that this kind of thing depends on the local clients never being able to change their IPs.

Last edited by win32sux; 09-18-2009 at 06:41 PM.
 
  


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
Shorewall keeps blocking xp clients. System-Core Linux - Networking 5 10-05-2007 01:45 AM
Blocking a domain referrer from a webserver? Seventh Linux - Security 1 02-06-2007 04:28 PM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM
RH9 Firewall blocking webserver lsgko Linux - Newbie 3 08-17-2003 07:40 AM
Port forward blocking internal lan clients dulaus Linux - Security 1 06-06-2003 06:38 PM

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

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