07-03-2025 01:30 PM
Hi.,
Community People.
How best can i prevent my inside network from accessing a certain website:
for instance, url: www.Blinkstreamz with IP: 213.176.3.30.
''ip route 213.176.3.0 255.255.255.0 null0 name Blinkstreamz''
Can the above route suffice to block any IP from inside my network from accessing this website
Solved! Go to Solution.
07-03-2025 01:57 PM
Sure if this website use this public IP
All traffic will drop since egress interface is null
MHM
07-03-2025 06:51 PM
That might work. You might also limit the route statement to just the host IP.
Another alternative would be to use an ACL.
07-03-2025 08:51 PM
It works..as long as web site is having fixed IP Address. If the website "Blinkstreamz" uses CDNs or load balancers, it may operate over multiple IPs. In that case, better to use firewall rules if possible that block access based on domain names or a wider set of IP ranges.
Best regards
******* If This Helps, Please Rate *******
07-03-2025 09:51 PM - edited 07-03-2025 09:52 PM
Hello @2D-Technology Services
You could use an extended ACL like this, and apply it on your LAN interface in ingress:
ip access-list extended BLOCK_BLINKSTREAMZ
deny ip any host 213.176.3.30 log
permit ip any any
interface gix/x
ip access-group BLOCK_BLINKSTREAMZ in
This will block all protocols (TCP, UDP, ICMP) to 213.176.3.30 and alowing everything else.
07-03-2025 11:23 PM
07-03-2025 11:24 PM
Thanks..
07-04-2025 11:09 AM
Some commentary on other replies.
@balaji.bandi has touched upon one of the classical issues in blocking traffic to another site not under your control, i.e. IPs might change (as first noted by @Blue_Bird ). His suggestion of using scripting, including possibly on-router scripting, to recurrently check DNS to block IP, and remediated IP on router, is a great way to avoid the need, in theory, to manually monitor and reconfigure the router if DNS to IP changes.
Oh, and BTW, another possible approach would be to block the DNS resolution for that name, but that would allow someone that otherwise knows the IP to get to the site.
An ACL blocking access might be used as an ingress or egress ACL. Generally, ACLs are recommended to be applied ASAP to avoid needless processing of packets that will be dropped. However, keep in mind, that as initial session setup packets will be dropped, such sessions won't be formed, i.e. most of to be blocked traffic would be the follow on session traffic, where you block the traffic probably matters little, except for convenience. For example, doing all the blocking in one place, such on the Internet connecting router (as as the ISP connecting interface, which you asked about), would likely be the easiest to maintain.
The logic also applies to using the null route approach too (i.e. you should only need to do that in the Internet connecting router).
In M02@rt37 's example ACL, he shows an ACE with the log option. Which is great for logging what host IP is attempting access, but, in theory, slightly more resource intensive (I recall, traditionally an ACL is more resource intensive than a null route), however, keep in mind what I wrote above, since sessions are being initially blocked, there shouldn't be a huge number of such packets to block to route to null. (In other words, again, don't worry about "efficiency">)
07-04-2025 11:13 AM
There are many way to drop traffic
One using routing
Other using ACL
What different' if you apply ACL then router will check each traffic pass is it permit or deny
Where when use rib it low intensive to CPU where only this destiantion will routing to null and drop
MHM
07-03-2025 01:57 PM
Sure if this website use this public IP
All traffic will drop since egress interface is null
MHM
07-03-2025 06:51 PM
That might work. You might also limit the route statement to just the host IP.
Another alternative would be to use an ACL.
07-03-2025 11:24 PM
Thanks..
07-03-2025 08:51 PM
It works..as long as web site is having fixed IP Address. If the website "Blinkstreamz" uses CDNs or load balancers, it may operate over multiple IPs. In that case, better to use firewall rules if possible that block access based on domain names or a wider set of IP ranges.
Best regards
******* If This Helps, Please Rate *******
07-03-2025 09:51 PM - edited 07-03-2025 09:52 PM
Hello @2D-Technology Services
You could use an extended ACL like this, and apply it on your LAN interface in ingress:
ip access-list extended BLOCK_BLINKSTREAMZ
deny ip any host 213.176.3.30 log
permit ip any any
interface gix/x
ip access-group BLOCK_BLINKSTREAMZ in
This will block all protocols (TCP, UDP, ICMP) to 213.176.3.30 and alowing everything else.
07-03-2025 11:23 PM
Hi M02@RT37
Can I also apply this on the interface facing my ISP.
07-04-2025 11:13 AM
There are many way to drop traffic
One using routing
Other using ACL
What different' if you apply ACL then router will check each traffic pass is it permit or deny
Where when use rib it low intensive to CPU where only this destiantion will routing to null and drop
MHM
07-03-2025 11:49 PM
i don't have in hand to offer that script some where in my archive i have tested, i will post when i find it
you can use EEM script or external script to check the DNS Lookup against the domain, if the IP change amend the ACL to the router.
by the what Router and IOS, make sure you have latest code of 15.x to be there to work as expected, 12.X have some limitation.
07-04-2025 11:09 AM
Some commentary on other replies.
@balaji.bandi has touched upon one of the classical issues in blocking traffic to another site not under your control, i.e. IPs might change (as first noted by @Blue_Bird ). His suggestion of using scripting, including possibly on-router scripting, to recurrently check DNS to block IP, and remediated IP on router, is a great way to avoid the need, in theory, to manually monitor and reconfigure the router if DNS to IP changes.
Oh, and BTW, another possible approach would be to block the DNS resolution for that name, but that would allow someone that otherwise knows the IP to get to the site.
An ACL blocking access might be used as an ingress or egress ACL. Generally, ACLs are recommended to be applied ASAP to avoid needless processing of packets that will be dropped. However, keep in mind, that as initial session setup packets will be dropped, such sessions won't be formed, i.e. most of to be blocked traffic would be the follow on session traffic, where you block the traffic probably matters little, except for convenience. For example, doing all the blocking in one place, such on the Internet connecting router (as as the ISP connecting interface, which you asked about), would likely be the easiest to maintain.
The logic also applies to using the null route approach too (i.e. you should only need to do that in the Internet connecting router).
In M02@rt37 's example ACL, he shows an ACE with the log option. Which is great for logging what host IP is attempting access, but, in theory, slightly more resource intensive (I recall, traditionally an ACL is more resource intensive than a null route), however, keep in mind what I wrote above, since sessions are being initially blocked, there shouldn't be a huge number of such packets to block to route to null. (In other words, again, don't worry about "efficiency">)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide