Any way to block inbound IP range or IPs via config or API? #1043
-
Any way to block inbound IP range or IPs via config or API? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @CodeMonkeyKevin, Thank you for your interest. At the moment Forwarder doesn't expose an option to block specific IPs through CLI or API. iptables -I INPUT -p tcp --dport 3128 -s 203.0.113.0/24 -j DROP If you’d prefer everything in a single Go binary, you can write a tiny Best, |
Beta Was this translation helpful? Give feedback.
Hi @CodeMonkeyKevin,
Thank you for your interest.
At the moment Forwarder doesn't expose an option to block specific IPs through CLI or API.
If you need to shut out certain clients right now, the quickest solution is to use the host firewall.
For example on Linux you can use iptables:
If you’d prefer everything in a single Go binary, you can write a tiny
forwarder.RequestModifier
that checksreq.RemoteAddr
and returns an error when the client’s IP matches a deny-list; Forwarder will respond with 403 Forbidden and the request won’t be proxied. I’m happy to share a short example if that would help.Best,
Hubert