-
Notifications
You must be signed in to change notification settings - Fork 370
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
Egress use external IP on eno2 #6547
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
i want use High-Availability Egress with IPs in subnet 112.1.6.0/24 not in the same subnet as the Node IPs,
|
@yeshl Does the node that runs the pod have eno2 and an IP from the |
The node50/node51 have tow NIC: eno1(10.0.3.0/24) and eno2(no ip), but other nodes have only one NIC eno1(10.0.3.0/24) . i use metallb High-Availability IP(112.1.6.11/24) on node50/node51,it work very well!! but metallb can only do dnat, i think antrea Egress can do snat,so i use Egress in the same subnet as metallb (112.1.6.11/24),but it can't work! ..... |
Is node50 the one running the test Pod? Can other nodes reach eno2's IPs via direct route or default gateway? This is a requirement to make Egress work as mentioned in https://github.com/antrea-io/antrea/blob/main/docs/egress.md#egressip:
|
@yeshl is this a good representation of your network topology: I think you could get it to work if you manually add the routes I wrote in italics in the diagram. Edit: I added the @tnqn I feel like we have been getting quite a few queries like this, with similar use cases:
I don't know if the current implementation can really handle these use cases very well. There seems to be some general confusion about how |
@antoninbas thank u!
For matelLB,As long as the above route is added, it can work very well!!! antrea egress can work after I add the following route and ip.(but I hope the following route and IP shouldn't be added !,It disrupted high availability for egress)
refer to the implementation of matelLB, it is done very well! Additionally,The CRD ExternalIPPool appears to use an external IP address such as 112.1.6.99(not 192.168./172./10.*), but in reality it requires the IP in nodes subnet, which is really puzzling! |
The Egress IP needs to be routable from any Node, which is not the same as "it requires the IP in nodes subnet" In the example diagram above, I am adding a route for the Egress "subnet" on every Node manually, which is why the "routable from any Node" requirement is met and why it works. |
@antoninbas Sorry for the late reply. I agree it should be improved or clarified. I will take a look at this and think about it tomorrow or next week. |
a flexible solution:
|
@yeshl If I understand your requirement correctly, I think this can be supported by I think this can be resolved by having a separate configuration to specify the interface that the Egress traffic should leave from when |
@tnqn, yes i would like to try it!! Actually, we have already used it by add ip rules。but antrea always inserts policy routing at the front!maybe It could specify a priority, just like table 101 priority 101?
|
|
@yeshl could you replace the image of antrea-agent with
I have tested it in my cluster and it worked. If it also works for you, I will submit a PR. Note that there are a few reasons why it's in the configuration file but isn't an Egress/ExternalIPPool resource parameter.
This is only a draft to validate the approach. If egress nodes have different interface name, we could make it a list or have some ways to discover the external interface in the official patch. |
|
Does Node |
when i add a ip on eno4, such as 112.1.6.111/24,it worked! |
It's kind of expected. The (floating) Egress IPs are assigned to Antrea managed virtual interfaces, instead of the "physical" interfaces, not having any IP on the external interface would break how IP/ARP works on linux, e.g. rp_filter, arp reply. It would also affect how external traffic is routed between other Nodes and this egress Node (you would need to configure extra routes even if the Node is already in the same network). Besides, how would such Nodes reach external network when non Egress IP is assigned to it? Does it make sense rely on VIPs for external connectivity? For these reasons, the fixed IP on the external interface doesn't seem wasted. And given the complexity of making it work without an fixed IP, it may need to be considered a prerequisite for utilizing the capacity at the moment. |
u are right!But our number of IPs is limited, is there a solution that doesn't waste IPs? |
You mean there are two gateways in the network, one for Node, and one for Pod? |
You mean metallb for ingressIP can work when there are no fixed IP on eno4? I thought it would have the same issue: fp_filter would drop the packets unless both all and this interface's flag are set to 0. |
I hope antrea won't check if there is an IP address on eno4,Just create antrea-egress0 and set the egressIP(floating IP)on it!
|
My point was that the traffic wouldn't work even if we remove the IP check because how rp_filter and arp work in linux as I mentioned in #6547 (comment). And I think metallb wouldn't work either without fixed IPs on your eno4. But I see the article you pasted mentioned the same issues that I pointed out and it sounds like you plan to resolve these issues by configuring the nodes' sysctl following the article? If yes, we could remove the IP check in antrea and let users to decide how they make the external interface's routing/arp works. Note that when there is no fixed IP on external interface, you would need to configuring the nodes' sysctl yourself (like configuring |
@tnqn Yes, you have considered it very thoroughly. I suggest removing the IP check and instead outputting a warning message in the logs, informing the user that they can resolve the issue by setting the IP or using sysctl. This approach is more flexible and gives users more options! |
node host subnet 192.168.3.0/24 on NIC eno1, external subnet 112.1.6.0/24 on NIC eno2
how to specifying IP 112.1.6.96/24 (SNAT) the traffic from the selected Pods to the external network should use.
The text was updated successfully, but these errors were encountered: