LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-22-2008, 01:14 PM   #1
hadolfov
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Rep: Reputation: 0
To block youtube


Hello!
i need to block youtube, so anybody in my network can access it, i have add this lines to mi firewall script, but dont work.

${IPTABLES} -A INPUT -s 208.65.153.253 -j DROP
${IPTABLES} -A OUTPUT -d 208.65.153.253 -j DROP
${IPTABLES} -A INPUT -s 208.65.153.251 -j DROP
${IPTABLES} -A OUTPUT -d 208.65.153.251 -j DROP
${IPTABLES} -A INPUT -s 208.65.153.238 -j DROP
${IPTABLES} -A OUTPUT -d 208.65.153.238 -j DROP

Any idea?

Thank you!
 
Old 02-22-2008, 01:28 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Not enough info -- you're appending rules, so we need to see the rules that precede it. Post the results of # iptables -nvL (in code tags so that it's readable).
 
Old 02-22-2008, 01:53 PM   #3
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by anomie View Post
Post the results of # iptables -nvL (in code tags so that it's readable).
Usually easier to read is the output of iptables-save.
 
Old 02-22-2008, 02:01 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
To each his own. I don't like the format as much, but either will do.
 
Old 02-22-2008, 04:58 PM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
This is definitely not something you'd wanna do with iptables. You'll never be able to keep up with all the IPs. A proxy server is much better suited for this, as you'd just block "youtube.com" without having to worry about any IPs.

Having said that, you mentioned a "network" yet you posted INPUT/OUTPUT rules. If this is a network firewall you'd need to use the FORWARD chain instead of INPUT/OUTPUT. That might explain why your rules aren't having any effect.

Last edited by win32sux; 02-22-2008 at 05:15 PM.
 
Old 02-22-2008, 05:40 PM   #6
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
If you host your own DNS you can "poison" your DNS by making a zone for youtube. Then point it at 127.0.0.1. Also you can do this with /etc/hosts if this is a standalone machine.

-C
 
Old 02-22-2008, 05:59 PM   #7
internetSurfer
Member
 
Registered: Jan 2008
Location: w3c
Distribution: Slackware 12 Zenwalk 5.2
Posts: 71

Rep: Reputation: 16
"YouTube.com owns the entire 208.65.153.0 to 208.65.153.255 range,
so you can use a firewall rule to block all TCP connections on
Port 80 (or more if you want to block everything possible) using
the CIDR of 208.65.153.0/24"

_

Last edited by internetSurfer; 02-28-2008 at 02:50 PM.
 
Old 02-22-2008, 06:07 PM   #8
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Yeah, if you are 100% positive that youtube.com only uses 208.65.153.0/24 then you should be able to cut your network clients off from it by using something like:
Code:
iptables -I FORWARD -i $LAN_IFACE -o $WAN_IFACE -d 208.65.153.0/24 -j REJECT
They will, of course, still be able to bypass the restriction by using VPN, Tor, a remote proxy, etc.

Last edited by win32sux; 02-22-2008 at 06:09 PM.
 
  


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
Kubuntu And Youtube Chronothread Linux - Software 3 12-09-2007 08:13 PM
How can I block Youtube on our office network rkelsen General 9 09-22-2007 04:01 PM
Youtube.com = no sound Micro420 Ubuntu 6 07-21-2006 12:53 AM
no volume in youtube? lilili Linux - Newbie 6 07-20-2006 09:29 PM
I can't hear Youtube anatman Linux - Newbie 5 06-09-2006 03:49 PM

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

All times are GMT -5. The time now is 06:18 PM.

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