dos traefik Middleware support ipblacklist?
I see only ipwhitelist
Please check the follwing link https://docs.traefik.io/middlewares/ipwhitelist/
I am quite sure you can do that with ipwhitelist
can this ipwhitelist block a ip?
how ?
Hello,
i dont think, i use iptables for that actually but for other reasons too
Any ip not in the list will be blocked.
IPWhitelist accepts / refuses requests based on the client IP.
It's clear in the documentation page. Did you check out?
the block ip is konw,but the ip allow come in is not know.
so ipwhitelist can not block one or two ip.
That is not true, ipwhitelist can block a list of ip(s) (CIDR or single one).
Can you explain what do you want to achieve ?
ipwhitelist is allow ip,not block
the docs not Explana how to refuses requests based on the client IP
or i don't know how to set it with kv
Have you tried?
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: known-ips
namespace: traefik
spec:
ipWhiteList:
sourceRange:
- 0.0.0.0/0. <--- remove it for allow only localhost and block all
- 127.0.0.1/32
IPWhitelist works like a deny all policy, so you have to add the list of ips (CIDR) to allow access to your backend.
if I want to block two ip like 22.22.22.22 , 33.33.33.33
how to set it