Author Topic: Problems hosting an internet game from PC that has virtual network interface  (Read 4685 times)

foobarto

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
I've found an issue with TNet that occurs only if I have a virtual NIC (from VirtualBox) enabled and someone tries to connect to the host via internet. As far as I can tell the UPnP tries to open up port on the Virtual NIC rather than on the real one resulting in a warning:

Quote
UPnP discovery failed (A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond.
)

As expected others can join the host over LAN.

Disabling the virtual NIC solves the issue.

Is there a way to make the UPnP try to open up port via the interface that is used for default route? Or on all interfaces?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
UPnP message is harmless. It simply means that the Universal Plug & Play gateway cannot be reached, so TNet isn't able to open a port for you automatically -- and you have to do it manually by going to your router.

Next version of TNet supports multiple network interfaces, letting you choose which one to use.

foobarto

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Hi ArenMook, thanks for the reply.

You misunderstood my report :)

I know the warning is harmless... But it results in inability to join host via internet.

Note that when I disabled the VirtualNIC there was no warning any more and others could join via internet. My router is UPnP capable and TNet does work with it.

All I'm saying is UPnP implementation in TNet is attempting to send the UPnP to the gateway on a network that is not the default and gives up too easily.

Imho best approach would be to use the NIC that has the default gw reachable through it.

  1. C:\Users\bart>netstat -rn
  2. ===========================================================================
  3. Interface List
  4.   4...64 66 b3 17 e5 3b ......Qualcomm Atheros AR938x Wireless Network Adapt
  5.   3...ac 22 0b c5 45 18 ......Intel(R) Ethernet Connection I217-V
  6.   9...08 00 27 00 2c 55 ......VirtualBox Host-Only Ethernet Adapter
  7.   1...........................Software Loopback Interface 1
  8.   5...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
  9.  10...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
  10.  11...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
  11. ===========================================================================
  12.  
  13. IPv4 Route Table
  14. ===========================================================================
  15. Active Routes:
  16. Network Destination        Netmask          Gateway       Interface  Metric
  17.           0.0.0.0          0.0.0.0    192.168.192.1   192.168.192.61     20
  18.         127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
  19.         127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  20.   127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  21.      192.168.56.0    255.255.255.0         On-link      192.168.56.1    276
  22.      192.168.56.1  255.255.255.255         On-link      192.168.56.1    276
  23.    192.168.56.255  255.255.255.255         On-link      192.168.56.1    276
  24.     192.168.192.0    255.255.255.0         On-link    192.168.192.61    276
  25.    192.168.192.61  255.255.255.255         On-link    192.168.192.61    276
  26.   192.168.192.255  255.255.255.255         On-link    192.168.192.61    276
  27.         224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
  28.         224.0.0.0        240.0.0.0         On-link    192.168.192.61    276
  29.         224.0.0.0        240.0.0.0         On-link      192.168.56.1    276
  30.   255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  31.   255.255.255.255  255.255.255.255         On-link    192.168.192.61    276
  32.   255.255.255.255  255.255.255.255         On-link      192.168.56.1    276
  33. ===========================================================================

Note the following is the interface with default route (0.0.0.0):
  1. Active Routes:
  2. Network Destination        Netmask          Gateway       Interface  Metric
  3.           0.0.0.0          0.0.0.0    192.168.192.1   192.168.192.61     20
  4.  

TNet however is using the Virtual NIC (192.168.56.1)

  1. No arguments specified, assuming default values.
  2. In the future you can specify your own ports like so:
  3.    -name "Your Server"         <-- Name your server
  4.    -tcp [port]                 <-- TCP port for clients to connect to
  5.    -udp [port]                 <-- UDP port used for communication
  6.    -udpLobby [address] [port]  <-- Start or connect to a UDP lobby
  7.    -tcpLobby [address] [port]  <-- Start or connect to a TCP lobby
  8. For example:
  9. TNServer -name "My Server" -tcp 5127 -udp 5128 -udpLobby 5129
  10. IP Addresses
  11. ------------
  12. External: XXXX
  13. Internal: 192.168.56.1
  14. Gateway:  None found
  15.  
  16. UDP Lobby Server started on port 5129
  17. Game server started on port 5127
  18. Press 'q' followed by ENTER when you want to quit.
  19.  
  20.  
  21.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Yes, I understand. As I said support for multiple NICs has already been added to the Pro version, so you will be able to choose what you're working with in the next release. Current version in the Asset Store doesn't have support for multiple interfaces.

foobarto

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Sounds good :)

Any ETA on the Pro version? I've only did a quick search but didn't find any mention of it. Any hints on what other shiny functionality it will bring? :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
It was last weekend originally, but then I got side-tracked with improved serialization and decided to add that as well. Should be a few days. I'll post version notes when it's ready-ish.