I have been unable to get the ipWhiteList middleware to work with a tcp router. Can anyone provide a working example or perhaps point out the error in my configuration?
Right now I am getting this error:
"Cannot start the provider *file.Provider: /config/traefik-tcp.yaml: field not found, node: middlewares"
If I remove the middleware and definition then it loads the file.
I am also having this issue when attempting to use ipWhiteList for a TCP router:
time="2021-08-16T13:08:09-05:00" level=error msg="Error occurred during watcher callback: /etc/traefik/tcp.toml: error reading configuration file: /etc/traefik/tcp.toml - open /etc/traefik/tcp.toml: no such file or directory" providerName=file
time="2021-08-16T13:08:09-05:00" level=error msg="Error occurred during watcher callback: /etc/traefik/tcp_safe_save_130809.toml: field not found, node: middlewares" providerName=file
time="2021-08-16T13:08:09-05:00" level=error msg="Error occurred during watcher callback: /etc/traefik/tcp_safe_save_130809.toml: error reading configuration file: /etc/traefik/tcp_safe_save_130809.toml - open /etc/traefik/tcp_safe_save_130809.toml: no such file or directory" providerName=file
time="2021-08-16T13:08:09-05:00" level=error msg="Error occurred during watcher callback: /etc/traefik/tcp.toml: field not found, node: middlewares" providerName=file
time="2021-08-16T13:08:09-05:00" level=error msg="Error occurred during watcher callback: /etc/traefik/tcp.toml: field not found, node: middlewares" providerName=file
time="2021-08-16T13:08:09-05:00" level=error msg="Error occurred during watcher callback: /etc/traefik/tcp.toml: field not found, node: middlewares" providerName=file
I did find this documentation which seems to indicate my configuration is correct.
Edit #2: I can confirm updating my Traefik Docker container to the 2.5 tag does allow the ipWhiteList middleware to work for TCP.
time="2021-08-16T14:44:52-05:00" level=error msg="Connection from 68.235.52.123:12802 rejected: \"68.235.52.123:12802\" matched none of the trusted IPs" middlewareName=ipwhitelist@file middlewareType=IPWhiteListerTCP
time="2021-08-16T14:44:54-05:00" level=error msg="Connection from 3.144.121.130:33444 rejected: \"3.144.121.130:33444\" matched none of the trusted IPs" middlewareName=ipwhitelist@file middlewareType=IPWhiteListerTCP
time="2021-08-16T14:44:54-05:00" level=error msg="Connection from 3.144.121.130:33456 rejected: \"3.144.121.130:33456\" matched none of the trusted IPs" middlewareType=IPWhiteListerTCP middlewareName=ipwhitelist@file
time="2021-08-16T14:44:54-05:00" level=error msg="Connection from 3.144.121.130:33498 rejected: \"3.144.121.130:33498\" matched none of the trusted IPs" middlewareType=IPWhiteListerTCP middlewareName=ipwhitelist@file