It didnt work... now everyone has facebook again... any clue?
Main Topics
Browse All TopicsI have been told to block certain site (facebook) using Iptables. I did this succesfully. Now I want to let certain users to the site (my boss, who asked me to block the site lol).
I put this, I thought putting a rule to let her IPs before the blocking rule would work, but it doesnt...
$IPTABLES -A FORWARD -s 10.6.2.237/32 -d 0.0.0.0/0 -j ACCEPT #user
$IPTABLES -A FORWARD -s 10.6.3.3/32 -d 0.0.0.0/0 -j ACCEPT #user
$IPTABLES -A FORWARD -s 10.6.2.250/32 -d 0.0.0.0/0 -j ACCEPT #user
$IPTABLES -t nat -A PREROUTING -p tcp -s 10.0.0.0/8 -d 69.63.176.0/24 -j DROP #facebook block
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
uh? www.facebook.com, is a social-networking web site.
yes, I run ./rc.iptables everytime I change something
> uh? www.facebook.com, is a social-networking web site.
My question was: is it hosted on same box as the iptables are run?
> yes, I run ./rc.iptables everytime I change something
I hope it flushes the iptables
well, www.facebook.com is a third party website i want block my users from accesing to. Of course, is not in the same box, not even in the same network.
Well, I did /etc/init.d/iptables stop and flushed all the firewall rules with no success.
OK, so You are applying those rules on firewall - good. It should work with the FORWARD chain.
stop/start the firewall(so it's flushed and without Your rules), then apply those rules
$IPTABLES -N FACEBOOK
$IPTABLES -A FACEBOOK -s 10.6.2.237/32 -j ACCEPT #user
$IPTABLES -A FACEBOOK -s 10.6.3.3/32 -j ACCEPT #user
$IPTABLES -A FACEBOOK -s 10.6.2.250/32 -j ACCEPT #user
$IPTABLES -A FACEBOOK -s 10.0.0.0/8 -j DROP #facebook block
$IPTABLES -I OUTPUT -d 69.63.176.0/24 -j FACEBOOK
$IPTABLES -I FORWARD -d 69.63.176.0/24 -j FACEBOOK
#where 69.63.176.0/24 is the facebook IP/location
you may also answer this one.
http://www.experts-exchang
Business Accounts
Answer for Membership
by: ravenplPosted on 2008-04-15 at 09:07:52ID: 21359949
it hasn't worked because packet flies through PREROUTING chain, then FORWARD. So whole 10/8 gets blocked by PREROUTING
I think You should not use the PREROUTING chain here at all, just
$IPTABLES -A FORWARD -s 10.6.2.237/32 -d 0.0.0.0/0 -j ACCEPT #user
$IPTABLES -A FORWARD -s 10.6.3.3/32 -d 0.0.0.0/0 -j ACCEPT #user
$IPTABLES -A FORWARD -s 10.6.2.250/32 -d 0.0.0.0/0 -j ACCEPT #user
$IPTABLES -A FORWARD -s 10.0.0.0/8 -d 69.63.176.0/24 -j DROP #facebook block