Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Security > Blocking a port for ip in my lan and allow it for others

Forgot Password?
 Linux Security   Discussion about keeping your machines secure, and the crackers out.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 07-24-2009   #1 (permalink)
Just Joined!
 
Join Date: Dec 2006
Posts: 5
Blocking a port for ip in my lan and allow it for others

Hello all,
I want a situation where i want to restrict one pc in my lan not to browse the internet, to block http, https ports for that computer and allow other ports.

The lan ip i want to block its ip is 192.168.0.203, i dont want this ip to access http, https ports but can do other things. I want an iptables script or comman to use to achieve this.

Thanks your help will be apprieciated
sapanda is offline  


Reply With Quote
Old 07-25-2009   #2 (permalink)
Linux Engineer
 
Lazydog's Avatar
 
Join Date: Jun 2004
Location: The Key Stone State
Posts: 1,187
Take a look at this TUTORIAL
__________________

Regards
Robert

Linux
The adventure of a life time.

Linux User #296285
Get Counted
Lazydog is offline   Reply With Quote
Old 08-24-2009   #3 (permalink)
Just Joined!
 
Join Date: Aug 2009
Location: Mumbai, India
Posts: 46
Hi,

Assuming you are using iptables on the system on which to want to block outbound access to HTTP and HTTPS

iptables -I OUTPUT 1 -p tcp -m multiport --dport 80,443 -j DROP
iptables -I OUTPUT 2 -p tcp -j ACCEPT

The first rule blocks outbound traffic to port 80,443 while allowing traffic to other ports. If you are using RHEL, Fedora, CentOS you'll need to add the above lines except for the word iptables to the /etc/sysconfig/iptables file for it to be effective on subsequent reboots.

If you are configuring iptables on a another system through which traffic is routed to the internet, then the above rules change to

iptables -I FORWARD 1 -s 192.168.1.203/24 -p tcp -m multiport --dport 80,443 -j DROP
iptables -I FORWARD 2 -s 192.168.1.203/24 -p tcp -j ACCEPT

URL mentioned in the previous post would anyways give you detailed info.

-- Syd
syd05 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 01:12 PM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2