You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
My ISP is Orange, with a LiveBox v4 router by Sagem.
When using DiscoverDeviceAsync, it returns the router with its IPv6 address.
Trying to open port with the IPv6 fails likely because the router doesn't accept local IPv6, but only IPv4 ones.
Moreover, it's not possible to manually specify the local IPv4 in the request because the requesting IP should match the one in the entry added, so if it's done over the IPv6 network, then they won't be the same.
To fix that, I had to do in DiscoverDeviceAsync():
changed:
var devices = await DiscoverAsync(portMapper, true, cancellationTokenSource);
to:
var devices = await DiscoverAsync(portMapper, false, cancellationTokenSource); //TOO: Need them all, so can keep the IPv4 one if it's there
changed:
var device = devices.FirstOrDefault();
to:
NatDevice device = null;
foreach (var MyDevice in devices)
{
System.Net.IPAddress Ip = MyDevice.GetIPAddress();
if (Ip.AddressFamily != System.Net.Sockets.AddressFamily.InterNetworkV6)
{
device = MyDevice;
break;
}
}
if (device == null)
{
device = devices.FirstOrDefault();
}
Added support for GetIPAddress() to the device classes.
Side note: with Unity, the mappings aren't automatically removed, at least in the Editor.
The text was updated successfully, but these errors were encountered:
manutoo
changed the title
CreatePortMapAsync() fails with IPv6 router, with Error 600: Argument Value Invalid
CreatePortMapAsync() fails with IPv4+IPv6 router, with Error 600: Argument Value Invalid
Jan 17, 2021
My ISP is Orange, with a LiveBox v4 router by Sagem.
When using DiscoverDeviceAsync, it returns the router with its IPv6 address.
Trying to open port with the IPv6 fails likely because the router doesn't accept local IPv6, but only IPv4 ones.
Moreover, it's not possible to manually specify the local IPv4 in the request because the requesting IP should match the one in the entry added, so if it's done over the IPv6 network, then they won't be the same.
To fix that, I had to do in DiscoverDeviceAsync():
changed:
var devices = await DiscoverAsync(portMapper, true, cancellationTokenSource);
to:
changed:
var device = devices.FirstOrDefault();
to:
Added support for GetIPAddress() to the device classes.
Side note: with Unity, the mappings aren't automatically removed, at least in the Editor.
The text was updated successfully, but these errors were encountered: