Jump to content

Wich port to open when Firewall is actived


Recommended Posts

You need to open the rcon port for the game(s) in question, each game has its own rcon they don't all run on the same port.



Studeggle is correct so if a game runs on 27015 then the Rcon port is 27015. Keep in mind some games use seperate Rcon ports but most use the same port as the gameport.

Link to comment
Share on other sites

Yep, put the following in a batch file (.bat):


FOR /L %%A IN (27000,1,27040) DO netsh firewall add portopening UDP %%A "SRCDS Port "%%A
FOR /L %%A IN (27000,1,27040) DO netsh firewall add portopening TCP %%A "SRCDS RCON Port "%%A


Should be self explanatory on how to modify for other ports


Edit: I see you're talking about the TCAdmin scripts run on setup/removal. You can still do this, but replace the ports with the port variables in TCAdmin. I prefer just to run a port opening script once and be done. Having ports open but with nothing listening on them isn't a security risk.

Link to comment
Share on other sites

Go to Admin Home > System Settings > Supported Games

select your req game

Install/Uninstall Scripts


Install Script:

netsh firewall add allowedprogram "%gameserverexe%" %serverip%_%serverport% ENABLE


Uninstall Script:

netsh firewall del allowedprogram "%gameserverexe%"

Link to comment
Share on other sites

  • 11 months later...
You will have to add the ports manually, regretfully you can't rerun the install scripts, which is annoying if you add a new feature to the install script such as port opening.


to run install scripts again just use the following tcascript (made by Luis) :


<language name="VB" />
<waitForUserAction value="true"/>


Imports System

Class ExecuteScript
   Public Shared Sub Main()
       Dim services() As TCAdminSDK.Objects.Service = TCAdminSDK.Objects.Service.GetServicesByServerId(TCAdminSDK.Info.GetThisServerId())

       If Not services Is Nothing Then
           For Each service As TCAdminSDK.Objects.Service In services
                       Dim game As New TCAdminSDK.Objects.Game
                       game.GameID = service.GameId

                       Dim script As String = game.InstallScript()

                       Dim user As New TCAdminSDK.Objects.User(service.UserID)
                       'Load dynamic values 
                       Dim DynamicValues As TCAdminSDK.Remote.Plugins.GSAutomation.GameServerDynamicValues
                       With DynamicValues
                           .GameName = game.Name
                           .GameServerShortName = game.ShortName
                           .ServerIP = service.ServerIP
                           .ServerPort = service.ServerPort
                           .QueryPort = service.ServerQueryPort
                           .RCONPort = service.ServerRCONPort
                           .CustomPort1 = service.CustomPort1
                           .CustomPort2 = service.CustomPort2
                           .CustomPort3 = service.CustomPort3
                           .CustomPort4 = service.CustomPort4
                           .CustomPort5 = service.CustomPort5
                           .Slots = service.Slots
                           .HostName = String.Empty
                           .RCONPassword = String.Empty
                           .PrivatePassword = String.Empty
                           .IsPrivate = service.Private
                           .UserFilesPath = service.UserFilePath
                           .GameFilesPath = service.AutomationFilesPath
                           .OwnerUserID = service.UserID
                           .OwnerName = user.FullName
                           .OwnerPassword = TCAdminBase.Encryption.DecryptString128Bit(user.Password)
                           .PrimaryServiceID = service.PrimaryServiceID
                           .Application = service.Application
                           .GameKey = service.GameKey
                       End With

                       Dim servicescript As String = TCAdminSDK.Remote.Plugins.GSAutomation.ReplaceGameServerValues(script, DynamicValues)
		Dim server as new TCAdminSDK.Objects.Server
		server.ServerId = service.ServerID
		Console.WriteLine("Executing script on server {0}:", server.DisplayName)
                       Dim su As TCAdminBase.Plugins.IGenericPlugIn = TCAdminSDK.Remote.InstanceCreator.GetPluginFromServer(service.ServerID, "TCAdminMonitor.StandardPlugins.RemoteServers.ServerUtilities")
                       Dim exitcode As Integer = su.Execute(New Object() {"ExecuteScript", service.WorkingDirectory, servicescript})
                       Console.WriteLine("Executed script on {0} with exit code {1}", service.UniqueDisplayNameWithOwner, exitcode)
               Catch ex As Exception
                   Console.WriteLine("Error executing script on {0}: {1}", service.UniqueDisplayNameWithOwner, ex.ToString())
               End Try
       End If
   End Sub
End Class



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 4 Guests (See full list)

    • There are no registered users currently online
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use