Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prevent a workstation access the internet using iptables !! 1

Status
Not open for further replies.

hisham

IS-IT--Management
Nov 6, 2000
194
I used IP Masquerading to allow internet access to all computer in the lan, then I tried to prevent a workstation to access the internet :
iptables -A INPUT -p tcp -s 192.168.0.3 -j DROP
checking: iptables -L
target port opt source destination
DROP tcp -- station3.mydomain.com anywhere

but this station still access the internet !!

Thanks in advance for any help ..
 
Thank you thedaver, but how to do a PREROUTING stage ??
 
I'm sorry, I was thinking about something else.

You are right in your approach

The problem is that you have a rule before the one you are adding that has already allowed the IP to go out the firewall.

Remember that IPTables acts on the first rule that matches the situation. Be sure to place your blocking rule at the correct place in your IPTables chain. Probably higher than where you have it now.

 
The rule is best set in the FORWARD chain.
INPUT won't work. Iptables isn't going to look at this
traffic as you want. INPUT refers to traffic destined
for the local destination, not traffic that gets
forwarded, which is done after the masquerading.
INPUT -d 0/0 rules are not that useful except for
multiple interface boxes. All your rule does is
preclude client 192.x.x.x from accessing tcp based
services on the masquerading router.

BTW: This will not stop a knowledgeable programmer
from retrieving webpages if they have access to an
external udp http-gateway.
 
You are right marsd, it is working fine now when i set the rule in the FORWARD chain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top