-
Notifications
You must be signed in to change notification settings - Fork 332
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
T6183: interfaces openvpn: suppport specifying IP protocol version #3975
Conversation
👍 |
✅ No issues found in unused-imports check.. Please refer the workflow run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good idea but I think the UI has some room for improvement.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the point about dual-stack
now. I think dual-stack
is a good, descriptive name.
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 udp4
orprotocol udp6
. This adds a newip-version
option 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
client
andsite-to-site
mode, 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 ipv4
orip-version ipv6
lets 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
server
mode, 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 ipv6
orip-version ipv6-dual-stack
, you can force the server to listen on IPv6.The additional
ipv6-dual-stack
option is only supported inserver
mode (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.bindv6only
is disable, which it is on VyOS. By specifyingbind ipv6only
in the OpenVPN configuration, this "dual-stack" behavior is turned off by OpenVPN setting theIPV6_V6ONLY
socket option. I decided to set this by default whenip-version ipv6
is used, and offer an additional keywordip-version ipv6-dual-stack
for users that explicitly want the dual-stack behavior.How to test
Example dual-stack server configuration:
Smoketest result
Checklist: