Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

IPv6 not supported

Open jeremyvisser opened this issue 2 years ago • 5 comments

Describe the Bug

Currently, IPv6 is not used by any of the network sockets.

If you run netstat -lnp | grep sunshine, you can see all of the sockets bound to 0.0.0.0, not [::]. Also, if you look at https://github.com/SunshineStream/Sunshine/blob/master/sunshine/network.cpp, you can see it explicitly only binds with AF_INET.

On the server side, my ISP at puts me behind an IPv4 CGNAT, but has full end-to-end IPv6 connectivity.

And on the client side, both locations where I'd use it (either at work, or via my mobile) are also IPv6–only. (VPNs are not always feasible due to corp policy reasons.)

Expected Behavior

The Moonlight client supports IPv6. I expected to be able to connect to Sunshine using IPv6, but wasn't able to due to its lack of support.

Additional Context

No response

Sunshine Host Operating System and Version

Fedora 36

Architecture

x86_64

Sunshine Version

0.14.0

GPU Type

AMD

GPU Model

RX 6900XT

GPU Driver/Mesa Version

22.0.1

Capture Method (Linux Only)

Wayland

jeremyvisser avatar Jul 01 '22 02:07 jeremyvisser

Just adding the same test on powershell:

Get-NetTCPConnection -State 'Listen' -OwningProcess (Get-Process -ProcessName 'sunshine').Id
LocalAddress                        LocalPort RemoteAddress                       RemotePort State       AppliedSetting
------------                        --------- -------------                       ---------- -----       --------------
0.0.0.0                             48010     0.0.0.0                             0          Listen
0.0.0.0                             47990     0.0.0.0                             0          Listen
0.0.0.0                             47989     0.0.0.0                             0          Listen
0.0.0.0                             47984     0.0.0.0                             0          Listen

perroboc avatar Jul 12 '22 20:07 perroboc

I need ipv6 too

lengyefenghan avatar Jul 17 '22 09:07 lengyefenghan

@ReenigneArcher Any love for IPv6?

FallingSnow avatar Aug 12 '22 02:08 FallingSnow

I don't have IPv6 so no way to test

ReenigneArcher avatar Aug 12 '22 02:08 ReenigneArcher

It should be possible to test streaming from IPv6 localhost (::1) if your network doesn’t have real IPv6 connectivity.

cgutman avatar Aug 12 '22 05:08 cgutman

Yes, it should be possible to connect to localhost for testing. On Linux, listening on ::0 also listens on 0.0.0.0 AFAIK.

One use-case is to stream over a WireGuard or other VPN connection that uses IPv6 address to identify endpoints (IPv4 are possible too, but IPv6 provides much more freedom for addressing.

Here's a simple wireguard example with wg-quick. Put it in /etc/wireguard/connect.conf, then activate with systemctl start wg-quick@connect on both machines. Server (note that wireguard doesn't have the concept of server or client, but here we take server as a computer whose endpoint we can specify with a static IP address):

I picked addresses from the fd00::/8, which are for private use

[Interface]
Address = fd42:1234:5678::1/128
Privatekey = xxxx # output of wg genkey
ListenPort = 54321

[Peer]
AllowedIPs = fd42:1234:5678::2/128
PublicKey = yyyyPUB # output of echo yyyy | wg pubkey

Client:

[Interface]
Address = fd42:1234:5678::2/128
Privatekey = yyyy # output of another wg genkey
ListenPort = 11188

[Peer]
AllowedIPs = fd42:1234:5678::1/128
PublicKey = xxxxPUB # output of echo xxxx | wg pubkey

MayeulC avatar Sep 04 '22 12:09 MayeulC

You don’t even need WireGuard. Just use IPv6 on your local network. Pick a /64 subnet under fc00::/7, and give addresses out of that subnet to your computers. You won’t get internet access, but it’s more than sufficient for testing and development.

jeremyvisser avatar Sep 04 '22 22:09 jeremyvisser

Or just use link-local addresses, I agree. I was pointing out an easy way to test over the net.

As an aside, Wikipedia says that fc00::/8 has been reserved for future use, so I wouldn't use that, even though it's effectively unused.

MayeulC avatar Sep 05 '22 07:09 MayeulC

You don’t even need WireGuard. Just use IPv6 on your local network. Pick a /64 subnet under fc00::/7, and give addresses out of that subnet to your computers. You won’t get internet access, but it’s more than sufficient for testing and development.

I also have this problem. Have you solved this problem

8373907 avatar Sep 07 '22 07:09 8373907

I need IPv6 too. I would be very grateful if Sunshine could support IPv6.

xiaohaoxiang avatar Oct 04 '22 12:10 xiaohaoxiang