Ubuntu: Block anything from certain IP, injected from ISP when tethering from phone


My ISP injects JavaScript files - most notabily bmi.js - and certain other unwanted additions to web requests when tethering from my phone.

It would be OK if the JavaScript was useful, but it is programmed terribly - and as a JavaScript developer, this really annoys me when the injected scripts break my own work! It looks like it annoys some other people too...

I'd like to block any activity to the IP address 1.2.3.*. I've noticed and in use, or if anyone can give me any better solutions, I'd be happy to try.



I have to agree with George Edison with That sounds like a terrible ISP. The plot thickens ... while playing around with iptables and the like, I noticed that as soon as I blocked, the script was simply injected from another domain. I blocked that, it moved on to another.

In my web browser, I can access the script from ANY DOMAIN! What the heck is the ISP doing here? For example, these URIs all respond with the script:


and nauseatingly:

  • http://ScriptInjection-WhyDoYouExist.com/bmi-int-js/bmi.js
  • http://google.com/bmi-int-js/bmi.js
  • http://askubuntu.com/bmi-int-js/bmi.js

face palm


In Firefox NoScript add-on open Options > Advanced > ABE, USER ruleset, then add:

Site */bmi.js  Deny INCLUSION(SCRIPT)  

Of course you can also use regular expressions, and combine multiple URL patterns in the same rule.

You can find more info here: http://noscript.net/abe.


The page you linked to in your question contains the following comment:

I have found a solution! :D
On your iPhone go to Settings > General > Network > Cellular Data Network
Then Under “Cellular Data” change the APN to “mobile.o2.co.uk”
And change the Username to “bypass” (no quotes in both cases)
Then save the settings and restart your iPhone and the bmi.js file should no longer show up while tethering. Leaving you with full resolution browsing! The iPhone browser also appears a lot better since it was also affected by the js file.


aim your web browser @ and you'll be able to turn off image compression which will remove that annoying javascript injection (worked on t-mobiles network anyway)

if that does not work, use adblock for firefox/chrome to blacklist the bmi.js file

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »