Bug 273664 - ovpn(4) DCO module doesn't support "multihome" option
Summary: ovpn(4) DCO module doesn't support "multihome" option
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.0-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL: https://github.com/OpenVPN/openvpn/is...
Keywords: easy, regression, standards
Depends on:
Blocks:
 
Reported: 2023-09-09 21:51 UTC by Marek Zarychta
Modified: 2023-09-20 15:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Zarychta 2023-09-09 21:51:00 UTC
For a longer period of time, we have security/openvpn deployed with a "multihome" runtime option for failover and redundancy. With one[1] simple PF rule redundancy is achieved. The tun(4) driver supports this mode still fine in stable/14, whilst ovpn(4) can also send and receive unencrypted packets on the LAN side, the encrypted ones don't show up on the right interface. They appear on the main interface instead of $backup_if and thus the rule[1] is silently ignored.

[1] pass in quick on $backup_if reply-to ($backup_if $backup_gw) proto udp to ($backup_if) port $ovpnport
Comment 1 Marek Zarychta 2023-09-10 05:28:06 UTC
There is also a positive side of this bug: "multihome" is ignored but harmless to DCO on FreeBSD, users of other OSes are not that lucky[1].

[1]https://github.com/OpenVPN/openvpn/issues/390
Comment 2 Marek Zarychta 2023-09-10 12:30:32 UTC
In other words, the outgoing interface for encrypted traffic is chosen on the basis of the FIB lookup instead of preserving the IP address for the VPN connection and sending the traffic from the same interface it was received on.
Comment 3 Marek Zarychta 2023-09-11 05:27:30 UTC
I have submitted similar the report to OvpeVPN DCO: https://github.com/OpenVPN/ovpn-dco/issues/47
Comment 4 Marek Zarychta 2023-09-11 09:27:56 UTC
The issue was transferred to https://github.com/OpenVPN/openvpn/issues/409
Comment 5 Marek Zarychta 2023-09-11 17:44:20 UTC
After investigating it a bit further I was told by OpenVPN devs that "multihome will ensure that the UDP source IP is the one that the other end sent its packets to".
It's not yet supported by FreeBSD DCO implementation which only performs simple route lookup and sends the packets with the source IP of the outgoing interface.
It's a minor bug of our DCO module, perhaps it will be fixed in the future, but apparently, Linux implementation does support "multihome" just fine.