LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2013, 12:38 PM   #1
student23
LQ Newbie
 
Registered: Jan 2012
Posts: 21

Rep: Reputation: Disabled
How to block a website by its IP address(s) in Tomato firmware for routers


Hello everyone,

I'm trying to figure out how to block a website by its IP address in Tomato firmware version 1.28

I've read on other forums that you can add websites to Advanced > DHCP/DNS > Dnsmasq Custom Configuration "address=/facebook.com/127.0.0.1" but it doesn't work for me.

I have also tried adding the the rules or statements below in Administration > Scripts > Firewall but it doesn't work.

iptables -I INPUT -s 173.252.110.27 -j DROP

iptables -t nat -A WANPREROUTING -s 173.252.110.27 -j DROP # inbound
iptables -t filter -A wanout -d 173.252.110.27 -j DROP # outbound

My main objective is to block https://www.facebook.com. I know that I can do this by adding facebook to Access Restriction but it doesn't block HTTPS.

I thank you in advance for your comments.
 
Old 06-01-2013, 04:27 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Sorry I don't know about your router. You can, however, enter IP addresses in /etc/hosts.deny to effectively block by address (you can do the same in IPTABLES).

Facebook's address, 173.252.110.27, would be entered in /etc/hosts.deny:
Code:
173.252.110.27
The range of Facebook addresses is (from whois 173.152.110.27)
Code:
NetRange:       173.252.64.0 - 173.252.127.255
CIDR:           173.252.64.0/18
Hope this helps some.
 
Old 06-01-2013, 04:50 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Some thoughts here.

https://www.linuxquestions.org/quest...096/page2.html

http://r3dux.org/2009/12/how-to-bloc...mato-firmware/

Last edited by jefro; 06-01-2013 at 05:02 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
Need help choosing DD-WRT or Tomato Router firmware RedNeck-LQ General 4 09-18-2011 03:19 PM
WRT54GL with Tomato (or similar) vs N router with stock firmware? sidewalking General 1 11-16-2009 03:31 PM
LXer: Tasty Tomato firmware for routers LXer Syndicated Linux News 1 01-29-2009 08:11 AM
LXer: Tomato Firmware Turns Your Cheap Wireless Router Into a Powerhouse LXer Syndicated Linux News 0 10-06-2008 12:20 PM
LXer: Introduction to Tomato Firmware LXer Syndicated Linux News 0 10-03-2008 12:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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