Forums Archived

This forum has been archived. No new posts can be made and no new users can sign up. It remains here for reference only.

Find the new forums here

ampfirewall not working on Ubuntu 20.04

  • 336 Views
  • Last Post 10 December 2021
Jaedca117 posted this 10 December 2021

Hello,
it is not possible for me to use ampfirewall service.
I already followed all steps on https://github.com/CubeCoders/AMP/wiki/AMP-systemd-script-(Linux)

root@server:~# /opt/cubecoders/amp/ampinstmgr updatefirewall amp
[Info] AMP Instance Manager v2.3.0.6 built 02/12/2021 15:38
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Info] Using UFW firewall.
[Info] No new firewall rules to add
[Info] No existing firewall rules to remove

What do I need to do that amp will add automatically firewall rules?

Some Information:

OS: Ubuntu 20.04.3 LTS
AMP: v2.3.0.6
Firewall: UFW
AMP-User: amp

Troubleshooting:

root@server:~# systemctl status ampfirewall.timer
● ampfirewall.timer - AMP Instance Manager Firewall
     Loaded: loaded (/etc/systemd/system/ampfirewall.timer; enabled; vendor preset: enabled)
     Active: active (waiting) since Fri 2021-12-10 10:10:47 CET; 4h 39min ago
    Trigger: Fri 2021-12-10 14:51:12 CET; 44s left
   Triggers: ● ampfirewall.service
       Docs: https://github.com/CubeCoders/AMP/wiki/AMP-systemd-script-(Linux)

Dec 10 10:10:47 server systemd[1]: Started AMP Instance Manager Firewall.
root@server:~# systemctl status ampfirewall.service
● ampfirewall.service - AMP Instance Manager Firewall
     Loaded: loaded (/etc/systemd/system/ampfirewall.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Fri 2021-12-10 14:46:13 CET; 4min 18s ago
TriggeredBy: ● ampfirewall.timer
       Docs: https://github.com/CubeCoders/AMP/wiki/AMP-systemd-script-(Linux)
    Process: 284913 ExecStart=/opt/cubecoders/amp/ampinstmgr --silent updatefirewall amp (code=exited, status=0/SUCCESS)
   Main PID: 284913 (code=exited, status=0/SUCCESS)

Dec 10 14:46:12 server systemd[1]: Starting AMP Instance Manager Firewall...
Dec 10 14:46:13 server systemd[1]: ampfirewall.service: Succeeded.
Dec 10 14:46:13 server systemd[1]: Finished AMP Instance Manager Firewall.

root@server:~# /opt/cubecoders/amp/ampinstmgr updatefirewall amp
[Info] AMP Instance Manager v2.3.0.6 built 02/12/2021 15:38
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Info] Using UFW firewall.
[Info] No new firewall rules to add
[Info] No existing firewall rules to remove

server:~# su - amp
amp@server:~$ ampinstmgr -l | grep -e Module -e URL
Module             │ McMyAdmin
URL                │ http://127.0.0.1:8080/
Module             │ Minecraft
URL                │ http://127.0.0.1:8081/
Module             │ Minecraft
URL                │ http://127.0.0.1:8083/
Module             │ srcds
URL                │ http://127.0.0.1:8084/
Module             │ srcds
URL                │ http://127.0.0.1:8085/
Module             │ srcds
URL                │ http://127.0.0.1:8086/
Module             │ ADS
URL                │ http://127.0.0.1:8082/
Module             │ srcds
URL                │ http://127.0.0.1:8087/
Module             │ Minecraft
URL                │ http://127.0.0.1:8088/

Edit

root@server:~# ampinstmgr dumpfirewall
[Info] AMP Instance Manager v2.3.0.6 built 02/12/2021 15:38
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Info] Using UFW firewall.
[Info] No firewall rules to display.

amp@server:~$ ampinstmgr dumpfirewall
[Info] AMP Instance Manager v2.3.0.6 built 02/12/2021 15:38
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Info] Using UFW firewall.
[Info] No firewall rules to display.

Order By: Standard | Newest | Votes
Mike posted this 10 December 2021

What's the output of ampinstmgr dumpfirewall ? It looks like it's already added all the rules it wants to so it has nothing to do.

Jaedca117 posted this 10 December 2021

Here is the output

root@server:~# ampinstmgr dumpfirewall
[Info] AMP Instance Manager v2.3.0.6 built 02/12/2021 15:38
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Info] Using UFW firewall.
[Info] No firewall rules to display.

amp@server:~$ ampinstmgr dumpfirewall
[Info] AMP Instance Manager v2.3.0.6 built 02/12/2021 15:38
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Info] Using UFW firewall.
[Info] No firewall rules to display.

Mike posted this 10 December 2021

What's the output of ufw status ?

Jaedca117 posted this 10 December 2021

UFW Status

root@server:~# ufw status
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
Teamspeak                  ALLOW       Anywhere
Armagetron                 ALLOW       Anywhere
Steam                      ALLOW       Anywhere
Teeworlds                  ALLOW       Anywhere
Unreal Tournament 99       ALLOW       Anywhere
SuperTuxKart               ALLOW       Anywhere
Apache Secure              ALLOW       Anywhere
Postfix                    ALLOW       Anywhere
Postfix Submission         ALLOW       Anywhere
Dovecot IMAP               ALLOW       Anywhere
Dovecot Secure IMAP        ALLOW       Anywhere
Postfix SMTPS              ALLOW       Anywhere
Certbot                    ALLOW       Anywhere
Minecraft SFTP             ALLOW       Anywhere
Minecraft                  ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
Teamspeak (v6)             ALLOW       Anywhere (v6)
Armagetron (v6)            ALLOW       Anywhere (v6)
Steam (v6)                 ALLOW       Anywhere (v6)
Teeworlds (v6)             ALLOW       Anywhere (v6)
Unreal Tournament 99 (v6)  ALLOW       Anywhere (v6)
SuperTuxKart (v6)          ALLOW       Anywhere (v6)
Apache Secure (v6)         ALLOW       Anywhere (v6)
Postfix (v6)               ALLOW       Anywhere (v6)
Postfix Submission (v6)    ALLOW       Anywhere (v6)
Dovecot IMAP (v6)          ALLOW       Anywhere (v6)
Dovecot Secure IMAP (v6)   ALLOW       Anywhere (v6)
Postfix SMTPS (v6)         ALLOW       Anywhere (v6)
Certbot (v6)               ALLOW       Anywhere (v6)
Minecraft SFTP (v6)        ALLOW       Anywhere (v6)
Minecraft (v6)             ALLOW       Anywhere (v6)

The relevant services should be Minecraft and Steam, because they share a few ports which should be managed by AMP.

[Minecraft]
ports=25565,25566,25567/tcp
[Minecraft SFTP]
ports=2223
[Steam]
ports=26900:27030/udp|27000:27025/tcp

Close