Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Egress using IPs from a separate subnet #5799

Merged
merged 2 commits into from
Jan 5, 2024

Commits on Jan 3, 2024

  1. Support Egress using IPs from a separate subnet

    By default, it's assumed that the IPs allocated from the pool are in the
    same subnet as the Node IPs. In some cases, users want to use IPs in
    different subnets as Egress IPs. Additionally, users may want to use
    VLAN taggaing to segment the Egress traffic and the Node traffic.
    
    The commit implements the requirements by introducing an optional field,
    `subnetInfo`, to the ExternalIPPool resource. The `subnetInfo` field
    contains the subnet attributes of the IPs in this pool. When using a
    different subnet:
    
    * `gateway` and `prefixLength` must be set. Antrea will route Egress
      traffic to the specified gateway when the destination is not in the
      same subnet of the Egress IP, otherwise route it to the destination
      directly.
    
    * Optionally, you can specify `vlan` if the underlying network is
      expecting it. Once set, Antrea will tag Egress traffic leaving the
      Egress Node with the specified VLAN ID. Correspondingly, it's
      expected that reply traffic towards these Egress IPs are also tagged
      with the specified VLAN ID when arriving the Egress Node.
    
    The implementation involves VLAN sub-interfaces and policy routing.
    
    * For a given subnet with a VLAN ID, a separate VLAN sub-interface will
      be created to hold the Egress IPs allocated from it. Egress traffic
      and its reply traffic will be sent over and received from the VLAN
      sub-interface for proper tagging and untagging.
    
    * For a given subnet, a separate route table will be created, routing
      the selected Egress traffic to the specified gateway, or to its
      neighbor.
    
    * For multiple Egress IPs associated allocated from the same subnet, a
      separate IP rule will be created for each Egress IP, matching its pkt
      mark and looking up the shared route table.
    
    The feature is gated by the alpha "EgressSeparateSubnet" feature gate.
    
    Signed-off-by: Quan Tian <[email protected]>
    tnqn committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    35612bd View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Address comments

    Signed-off-by: Quan Tian <[email protected]>
    tnqn committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    1f1f268 View commit details
    Browse the repository at this point in the history