T6183: interfaces openvpn: suppport specifying IP protocol version#3975
Merged
c-po merged 1 commit intovyos:currentfrom Aug 20, 2024
Merged
T6183: interfaces openvpn: suppport specifying IP protocol version#3975c-po merged 1 commit intovyos:currentfrom
c-po merged 1 commit intovyos:currentfrom
Conversation
|
👍 |
|
✅ No issues found in unused-imports check.. Please refer the workflow run |
dmbaturin
requested changes
Aug 13, 2024
Member
dmbaturin
left a comment
There was a problem hiding this comment.
It's a good idea but I think the UI has some room for improvement.
Contributor
Author
|
I pushed a new revision following this solution I proposed inline: #3975 (comment) Hopefully this makes it a little easier to follow the distinctions between the various options. I would still recommend reading the linked thread in full. |
dmbaturin
approved these changes
Aug 14, 2024
Member
dmbaturin
left a comment
There was a problem hiding this comment.
I understand the point about dual-stack now. I think dual-stack is a good, descriptive name.
c-po
approved these changes
Aug 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Currently, VyOS does not specify the IP protocol version when telling OpenVPN which transport protocol to use. E.g., if you configure a UDP server, it specifies
protocol udp. OpenVPN also supports specifying the IP protocol version, e.g.protocol udp4orprotocol udp6. This adds a newip-versionoption to the OpenVPN interface to allow specifying an explicit IP protocol version.Types of changes
Related Task(s)
https://vyos.dev/T6183
Related PR(s)
Component(s) name
interfaces openvpn
Proposed changes
In general, for
clientandsite-to-sitemode, specifying an explicit IP protocol version is rarely necessary. OpenVPN will tell the kernel to open a socket to the remote host, and the kernel will figure out what type of socket to open based on the remote host (e.g. does it resolve to an IPv4 address or an IPv6 address). Usingip-version ipv4orip-version ipv6lets users mandate a particular protocol, which could be useful if you are using a DNS hostname and want to ignore responses of a certain address family.For
servermode, particularly if you don't specify an explicitlocal-host(letting OpenVPN bind to all interfaces), the kernel tends to choose an IPv4 socket. By settingip-version ipv6orip-version ipv6-dual-stack, you can force the server to listen on IPv6.The additional
ipv6-dual-stackoption is only supported inservermode (I don't believe it makes sense in any other mode), and is to account for the following Linux behavior:When binding an IPv6 socket to the unspecified address, Linux will also send IPv4 traffic to the socket, by way of translating the IPv4 source address into an IPv6 address with the format
::ffff:<ipv4 address>. This assumes the sysctlnet.ipv6.bindv6onlyis disable, which it is on VyOS. By specifyingbind ipv6onlyin the OpenVPN configuration, this "dual-stack" behavior is turned off by OpenVPN setting theIPV6_V6ONLYsocket option. I decided to set this by default whenip-version ipv6is used, and offer an additional keywordip-version ipv6-dual-stackfor users that explicitly want the dual-stack behavior.How to test
Example dual-stack server configuration:
Smoketest result
Checklist: