Skip to content

Extend RouteMatch to support matching based on the request source #4535

@georgi-d

Description

@georgi-d

We have a use case where for the same virtual host different the request needs to be routed differently based on the source of the request.

There are two different ways to distinguish the source:

  1. Whether the the request comes from the same node where Envoy is running. Where for the request socket: tcp.src_address == tcp.dst_address. This check catches local connections on all interfaces.
  2. The request's tcp.src_address belongs to a specific subnet ex. 192.168.0.0/24

One possible solution I see is to extend the RouteMatch structure with:

message RouteMatch {
  ...
  enun RequestSourceType {
    // Request is comming from withing the same network node as Envoy
    SAME_HOST = 0,
    // Request is comming from outside of the node
    EXTERNAL_HOST = 1,
  }
  oneof source {
    RequestSourceType source_type;
    repeated string source_subnet;
  } 
}

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests. Not bugs or questions.help wantedNeeds help!

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions