Friday, March 30, 2012

Get public IP via console

Question

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.

Asked by ThiefMaster

Answer

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.

Answered by psychonic