block some www sites
block some www sites
Hi,
I have the 2.97 firmware installed in my DSL 2640T
I need help to understand how block of some websites using the routertech firmware.
for example: I want to block
http://www.facebook.*
http://www.orkut.*
http://www.twitter.*
tks
I have the 2.97 firmware installed in my DSL 2640T
I need help to understand how block of some websites using the routertech firmware.
for example: I want to block
http://www.facebook.*
http://www.orkut.*
http://www.twitter.*
tks
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: block some www sites
Try this, from telnet/ssh login prompt
Code: Select all
block.sh facebook.com
block.sh orkut.com
block.sh twitter.com
The Chief:
Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.

No support via PM. Ask all questions on the open forum.
Re: block some www sites
tks...
and what is the command to "revert" (unblock) ?
tks
Code: Select all
/var # block.sh
Syntax=block.sh <host> [NEW_IP]
Examples:
block.sh site1.com [redirects site1.com to default IP (127.0.0.1)]
block.sh site2.com 128.128.128.0 [redirects site2.com to 128.128.128.0]
/var # unblock.sh
-sh: unblock.sh: not found
tks
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: block some www sites
baraozemo wrote:and what is the command to "revert" (unblock) ?
Code: Select all
rm /var/tmp/dns.d/block_user.conf
killall dproxy
The Chief:
Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.

No support via PM. Ask all questions on the open forum.
Re: block some www sites
i tried that it did not workthechief wrote:Try this, from telnet/ssh login promptCode: Select all
block.sh facebook.com block.sh orkut.com block.sh twitter.com
even after a router restart
then logged in with winscp and went to the etc\hosts file and added the entry manually after a restart it was wiped clean
i'm now doing it again and will see if "save all" (saving all settings to flash) will keep settings between reboots
questions
1 . if the block.sh script had worked then do you need to run it each time via cron or some routine each time the router reboots ?
2. is there an easy way to block ip ranges ? or filter traffic using mime types
i'm looking to block
- *facebook.com/ajax/chat*
*facebook.com/images/chat*
*facebook.com/ajax/presence*
*.channel*.facebook.com/x/*/false/p_*
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: block some www sites
Well, it should work. Did you clear your browser cache, etc., etc.?
Yes.duke wrote:1 . if the block.sh script had worked then do you need to run it each time via cron or some routine each time the router reboots ?
No idea.duke wrote:2. is there an easy way to block ip ranges ? or filter traffic using mime types
The Chief:
Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.

No support via PM. Ask all questions on the open forum.
Re: block some www sites
what is the correct step to block sites.
for example:
block.sh facebook.com
after, is necessary to save/reboot the modem ?
or only "save" ?
for example:
block.sh facebook.com
after, is necessary to save/reboot the modem ?
or only "save" ?
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: block some www sites
No. The command should take effect immediately.baraozemo wrote: block.sh facebook.com
after, is necessary to save/reboot the modem ?
No, you cannot "save" it. The changes will be lost on reboot, unless you run the command on every boot-up (e.g., via the autoexec functions).baraozemo wrote:or only "save" ?
The Chief:
Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.

No support via PM. Ask all questions on the open forum.
Re: block some www sites
ok, is this the correctly way ?
(to install the filter in the boot / allways use it)
setenv autoexec.sh "block.sh facebook.com"
setenv autoexec.sh "block.sh orkut.com.*"
setenv autoexec.sh "block.sh twitter.com"
(to uninstall the filter)
unsetenv autoexec.sh "block.sh facebook.com"
unsetenv autoexec.sh "block.sh orkut.com.*"
unsetenv autoexec.sh "block.sh twitter.com"
(to install the filter in the boot / allways use it)
setenv autoexec.sh "block.sh facebook.com"
setenv autoexec.sh "block.sh orkut.com.*"
setenv autoexec.sh "block.sh twitter.com"
(to uninstall the filter)
unsetenv autoexec.sh "block.sh facebook.com"
unsetenv autoexec.sh "block.sh orkut.com.*"
unsetenv autoexec.sh "block.sh twitter.com"
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
Re: block some www sites
Wrong. You are simply overwriting the environment variable with different values. Only the last one will count. If you are going to block a lot of sites, you should create a script, and upload it to a minix partition on the router. If you can it "startup.sh", it will be executed automatically during bootup. If you are only going to block a few sites, you can do something likebaraozemo wrote: setenv autoexec.sh "block.sh facebook.com"
setenv autoexec.sh "block.sh orkut.com.*"
setenv autoexec.sh "block.sh twitter.com"
Code: Select all
setenv autoexec.sh "block.sh facebook.com && block.sh twitter.com && block.sh orkut.com"
setenv autoexec1.sh "block.sh blah_blah && block.sh bloo_bloo && block.sh blee_blee"
Unsetenv takes only one parameter - and, the second and third commands are doing nothing, since you have already unset the single variable.baraozemo wrote:(to uninstall the filter)
unsetenv autoexec.sh "block.sh facebook.com"
unsetenv autoexec.sh "block.sh orkut.com.*"
unsetenv autoexec.sh "block.sh twitter.com"
The Chief:
Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.

No support via PM. Ask all questions on the open forum.
-
- Newbie
- Posts: 9
- Joined: Sat Nov 20, 2021 6:50 pm
- Location: United States
- Contact:
-
So i try to block all country using cc_allow and add my country code and restart my firewall , i try to access the ssh using a vpn and still i can access my server..
Note, this is only a temporally block.. i will use filter block once done..
Note, this is only a temporally block.. i will use filter block once done..