Skip to content

RCON not accessible from the outside world #39

Description

@Marahin

Hi.

Great work with the image; I managed to deploy it to a Kubernetes cluster.
I have one issue though; even with 27015 tcp+udp forwarded, and with the RCON proxy set up to port 27050, it still does not allow external connections to be made to that RCON server. At least it's how I see the issue.

~ docker run --rm -it outdead/rcon
Enter remote host and port [ip:port]: 10.0.0.210:27050
Enter password: yyyyyy
Waiting commands for 10.0.0.210:27050 (or type :q to exit)
> echo "test"
"test"
> :q

➜  ~ docker run --rm -it outdead/rcon
Enter remote host and port [ip:port]: 193.x.x.x:27050
Enter password: yyyy
cli: auth: rcon: dial tcp 193.x.x.x:27050: i/o timeout

I am more or less confident with the port forwarding, as the 27015 and 27016 tcp+udp ports have been passed through and both I and other players are able to connect to the game server from the Internet (outside of LAN).
However, RCON still does not respond at all for the public address.

The following is a slightly redacted Kubernetes manifest in YAML (generated from JSONNET, so sorry for some boilerplate) containing both the deployment manifest and service manifest:

---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations: {}
  labels:
    name: cs
  name: cs
  namespace: cs
spec:
  minReadySeconds: 30
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      name: cs
  strategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      annotations: {}
      labels:
        name: cs
    spec:
      containers:
      - args: []
        env:
        - name: CS2_ADDITIONAL_ARGS
          value: -usercon
        - name: CS2_GAMEMODE
          value: "0"
        - name: CS2_GAMETYPE
          value: "3"
        - name: CS2_IP
          value: 0.0.0.0
        - name: CS2_LAN
          value: "0"
        - name: CS2_PORT
          value: "27015"
        - name: CS2_PW
          value: ""
        - name: CS2_RCONPW
          value: yyyyyy
        - name: CS2_RCON_PORT
          value: "27050"
        - name: CS2_SERVERNAME
          value: yyyyyyyy
        - name: CS2_STARTMAP
          value: de_mirage
        - name: HOME
          value: /home/steam
        - name: HOMEDIR
          value: /home/steam
        - name: STEAMGUARD
          value: yyyyyyyyy
        - name: STEAMPASS
          value: yyyyyyyyyyyy
        - name: STEAMUSER
          value: yyyyyyyyyyy
        image: joedwards32/cs2:latest
        imagePullPolicy: Always
        name: cs
        ports:
        - containerPort: 27015
          name: cs2-27015
          protocol: TCP
        - containerPort: 27015
          name: cs2-27015-udp
          protocol: UDP
        - containerPort: 27016
          name: cs2-27016
          protocol: TCP
        - containerPort: 27016
          name: cs2-27016-udp
          protocol: UDP
        - containerPort: 27050
          name: cs2-27050-tcp
          protocol: TCP
        stdin: false
        tty: false
        volumeMounts:
        - mountPath: /home/steam/cs2-dedicated
          name: data
      imagePullSecrets:
      - name: regcred
      initContainers: []
      securityContext:
        fsGroup: 1020
      terminationGracePeriodSeconds: 30
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: cs-pvc
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    metallb.universe.tf/allow-shared-ip: 10.0.0.210
  labels:
    name: cs-lb-tcp
  name: cs-lb-tcp
  namespace: cs
spec:
  loadBalancerIP: 10.0.0.210
  ports:
  - name: srv-cs2-27015-tcp
    port: 27015
    protocol: TCP
    targetPort: cs2-27015
  - name: srv-cs2-27016-tcp
    port: 27016
    protocol: TCP
    targetPort: cs2-27016
  - name: srv-cs2-27050-tcp
    port: 27050
    protocol: TCP
    targetPort: cs2-27050-tcp
  selector:
    name: cs
  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    metallb.universe.tf/allow-shared-ip: 10.0.0.210
  labels:
    name: cs-lb-udp
  name: cs-lb-udp
  namespace: cs
spec:
  loadBalancerIP: 10.0.0.210
  ports:
  - name: srv-cs2-27015-udp
    port: 27015
    protocol: UDP
    targetPort: cs2-27015-udp
  - name: srv-cs2-27016-udp
    port: 27016
    protocol: UDP
    targetPort: cs2-27016-udp
  selector:
    name: cs
  type: LoadBalancer

Expected behavior

I am able to connect to remote console through the external IP address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions