Whitelist TCP Traffic

Is there a way to whitelist TCP traffic akin to ACLs in HAProxy?

Trying to do something like this:

        entrypoints = ["https"]
        rule = "HostSNI(`kubernetes`)"
        middlewares = ["kube_whitelist"]
        service = "kubeapi"
        passthrough = true
            address = "kubernetes.default:443"

        sourceRange = [""]
1 Like

Hello @acaire,

Today there is no tcp middleware available in traefik v2.

Thought as much, thanks all the same!

There is a hope that one day we can configure some of the available middleware for TCP ?
Like whitelist, basicauth, ForwardAuth.
Or this is impossible by design?
Best regards,


I'd love to see middleware added to TCP (what's possible anyway). What I'm after most is IP Whitelisting for TCP services.

1 Like

Also looking for this feature!