运行Open.NAT库进行端口转发时出现问题

时间:2018-09-11 11:14:08

标签: c# portforwarding

我正在尝试使用库(Open.NAT)进行端口转发,问题是我得到的IP地址实际上不是我的外部ip地址,而且我的端口都没有转发

Here my External ip Address by this Library

My Actual Ip Address

我想在计算机上“ ping”该外部ip地址,并且可以正常工作,但是当我对任何其他计算机(未连接到我的网络)执行相同操作时,它没有响应

        var discoverer = new NatDiscoverer();
        var cts = new CancellationTokenSource(10000);
        var device = await discoverer.DiscoverDeviceAsync(PortMapper.Upnp, cts);
        var ip = await device.GetExternalIPAsync();

        await device.CreatePortMapAsync(new Mapping(Protocol.Tcp, 1600, 1700, "The mapping name"));

        Console.WriteLine("The external IP Address is: {0} ", ip);

为什么该库为我提供了错误的IP地址,而我的端口却没有转发?

0 个答案:

没有答案
相关问题