Regex based routing for linkerd


Issue type Feature request
linkerd-version: 1.5.1

We have a requirement of routing linkerd based on an ip-range,

Btw, I added a custom header, clientIp using io.l5d.header.token

curl -H "clientIp:" http://<l5d-service>:4140


Say I have two services serivceA & serviceB, I want to route them based on an ip-range, for instance,

  • IPs ranging from to should route to serviceA &
  • IPs ranging from to should route to serviceB

I believe that the above scenario can be achieved by hardcoding the ip-range to serviceA & B, but if the ip-range is large then we should be using something like regular expressions, As per my knowledge, DTABS support only wildcards like * (asterisk).

Is it possible to achieve this goal using existing linkerd’s configuration or can this be achieved by other means? This feature will be really beneficial for us.

Thanks in advance!


Hi @zshaik!

The way to accomplish this would be to use a custom identifier plugin. Your plugin could use a regex (or any other means of identifying ip ranges) to map requests with clientIp header with an IP in one range to the serviceA name and requests with clientIp header in another range to the serviceB name.

You would not be able to encode this just using the standard Linkerd identifiers and dtabs.

Hope this helps!


Sounds interesting, will dig into it. Thank you @Alex

closed #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.