Do source engine based games (in my case Portal 2) have a console command to display the public IP steam will use e.g. when inviting someone for coop?

Please do not suggest me windows commands like ipconfig or one of the "get my ip" websites; I know very well how to find out my current public IP. What I'm looking for is an easy way to debug why steam suddenly started to use my private (192.162.*) IP instead of the public one. And displaying the IP steam uses would be much easier than asking someone to try to join my game and then check his console for the ip.

  • "The IP-address Portal 2 uses" is not really relevant - it doesn't matter what IP-address Portal 2 thinks you have, as long as packets are correctly routed to your machine to the correct, open port. Mar 29 '12 at 23:55
  • Well it needs to tell the other player which IP to connect to. Besides that, I think it's supposed to open the necessary port(s) via UPNP; at least it worked a few days ago without any manual port forwarding and later stopped working without me changing anything. Mar 30 '12 at 7:15
  • Portal 2 does not open ports over UPNP - people would be pretty upset if it did. Come to think of it, I believe the Steam API has support for port punching (which is what allows, for instance, Skype and Hamachi to work without requiring you to forward ports) - this is probably what you were observing. Mar 30 '12 at 15:05
  • Skype does use UPNP ;) But yeah, you are right. Apparently steam had some problems yesterday evening - for example, the page where you can equip hats etc on your robot also did not load with an error and when I tried again today everything worked fine without any changes. Mar 30 '12 at 16:09

When in-game, and with a level loaded, the 'status' command in the game's developer console will show the exact detected public IP address that would be used to invite others.

The developer console can be enabled under Options -> Keyboard/Mouse.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.