IP addressing with Docker and multiple static IP addresses

OS Name/Version: Ubuntu 22.04.4 LTS

Product Name/Version: AMP Release “Callisto” v2.5, built 22/03/2024 17:32

Problem Description:
I have 5 ip addresses on the amp-server
172.31.10.60
172.31.10.61
172.31.10.62
172.31.10.63
172.31.10.64
and would now like to offer the docker container from a game (let’s take Valheim) on 172.31.10.62 in the network.
I made in the Valheim instance : Configuration/Security&Privacy/Server IP Address=172.31.10.62

ampinstmgr status
───────────────────┼──────────────────┼────────────┼─────────────────┼───────┼───
ADS01 │ ADS │ ADS │ 0.0.0.0 │ 8080 │ ✓
ValHeim01 │ ValHeim │ Generic │ 127.0.0.1 │ 8081 │ ✓

ufw status
Status: active

To Action From


8080/tcp ALLOW Anywhere # AMP Management Instance
2223/tcp ALLOW Anywhere # AMP:ADS01:FileManagerPlugin.SFTP.SFTPPortNumber
12820/udp ALLOW Anywhere # AMP:ADS01:ADSModule.Network.MetricsServerPort
2224/tcp ALLOW Anywhere # AMP:ValHeim:FileManagerPlugin.SFTP.SFTPPortNumber
2456/udp ALLOW Anywhere # AMP:ValHeim:GenericModule.App.Ports.$ApplicationPort1
2457/udp ALLOW Anywhere # AMP:ValHeim:GenericModule.App.Ports.$ApplicationPort2
8080/tcp (v6) ALLOW Anywhere (v6) # AMP Management Instance
2223/tcp (v6) ALLOW Anywhere (v6) # AMP:ADS01:FileManagerPlugin.SFTP.SFTPPortNumber
12820/udp (v6) ALLOW Anywhere (v6) # AMP:ADS01:ADSModule.Network.MetricsServerPort
2224/tcp (v6) ALLOW Anywhere (v6) # AMP:ValHeim:FileManagerPlugin.SFTP.SFTPPortNumber
2456/udp (v6) ALLOW Anywhere (v6) # AMP:ValHeim:GenericModule.App.Ports.$ApplicationPort1
2457/udp (v6) ALLOW Anywhere (v6) # AMP:ValHeim:GenericModule.App.Ports.$ApplicationPort2

And on overview on endpoint it shows : Endpoint: 172.31.10.61:2456

If I scan with a portscanner,
172.31.10.60,
172.31.10.61,
172.31.10.62 I only get port 8080 reachable, no server on no port seems to be running

The problem seems to be that the Valheim runs on 127.0.0.1 (local) and does not propagate to the IP address I specify.
The IP assignment did not work properly before when I had several IP addresses on the system and wanted to assign instances to the respective game server.
is there a guideline how to do this correctly, or is the IP address management in AMP buggy :slight_smile:

Does AMP show that the ports are open?

It seems so :
[Info] Port usage for ValHeim (ValHeim )
[Info] Instance is currently running.
[Info] LISTENING 8081 TCP (Core.Webserver.Port)
[Info] LISTENING 2224 TCP (FileManagerPlugin.SFTP.SFTPPortNumber)
[Info] LISTENING 2456 UDP (GenericModule.App.Ports.$ApplicationPort1)
[Info] LISTENING 2457 UDP (GenericModule.App.Ports.$ApplicationPort2)

What is your application IP binding set to in ADS?

SRY…where do I find the setting for “application IP binding set to in ADS” ?

Go to the top level and its under Configuration > Networking

Default AMP IP Binding : 172.31.10.60
Default Application IP Binding : 172.31.10.61
Docker External IP : 172.31.10.62

ampinstmgr status
[Info] AMP Instance Manager v2.5 built 22/03/2024 17:33
[Info] Stream: Mainline / Release - built by CUBECODERS/buildbot on CCL-DEV
Instance Name │ Friendly Name │ Module │ IP │ Port │ Up
────────────┼──────────────────┼────────────┼────────────
ADS01 │ ADS │ ADS │ 0.0.0.0 │ 8080 │ ✓
VallHeim01 │ VallHeim │ Generic │ 172.31.10.60 │ 8081 │ ✓

sudo ufw status : Status: inactive

but still no open ports if I scan 172.31.10.60 -64
Also not possible to connect with valheim client :frowning:

Set the default application IP binding to 0.0.0.0.

Default AMP IP Binding : 172.31.10.60
Default Application IP Binding : 0.0.0.0
Docker External IP : 172.31.10.62

Instance Overview is showing VallHeim ##### Endpoint: 172.31.10.62:2456

Still not able to connect via client, still no open ports with nmap…

The default AMP IP binding should be 127.0.0.1. Don’t use tools like nmap, they won’t show you anything useful. Use AMPs tools to check what’s listening/open.

Is this a home hosted server?

Jep, this is a homeserver, running on proxmox to provide multiple games to my family.
Had the same problem before with 2 MC server’s not running on different IP’s.
So I installed a fresh ubuntu server and a new amp instance.
right now i am “only” trying to map a valheim instance to an static ip
Network no problem, I connect via ssh to the amp-server.

So here latest settings :

Default AMP IP Binding: 172.31.10.60
Default Application IP Binding:127.0.0.1
Docker External IP : 172.31.10.62

Instance Overview Showing : VallHeim Endpoint: 0.0.0.0:2456
In the instance :

Network Port Status
SFTP Port 2224 TCP
Game Port 2456 UDP
Steam Query Port 2457 UDP
Connection Info
Primary Endpoint 172.31.10.62:2456
Connection Link steam://connect/172.31.10.62:2457

Valheim Instance Configuration / Security & Privacy
Server IP Address : 172.31.10.62

ampinstmgr -i VallHeim
[Info] AMP Instance Manager v2.5 built 22/03/2024 17:33
[Info] Stream: Mainline / Release - built by CUBECODERS/buildbot on CCL-DEV
Instance ID │ 48a8c510-1756-4541-adac-ec2dc023e070
Module │ GenericModule
Instance Name │ VallHeim01
Friendly Name │ VallHeim
URL │ http://172.31.10.60:8081/
Running │ Yes
Runs in Container │ Yes
Runs as Shared │ No
Start on Boot │ No
AMP Version │ 2.5.0.0
Release Stream │ Mainline
Data Path │ /home/amp/.ampdata/instances/VallHeim01

[Info] Port usage for VallHeim01 (VallHeim)
[Info] Instance is currently running.
[Info] LISTENING 8081 TCP (Core.Webserver.Port)
[Info] LISTENING 2224 TCP (FileManagerPlugin.SFTP.SFTPPortNumber)
[Info] LISTENING 2456 UDP (GenericModule.App.Ports.$ApplicationPort1)
[Info] LISTENING 2457 UDP (GenericModule.App.Ports.$ApplicationPort2)

Valheim client still not connecting :frowning:

You’ve still got it wrong. AMP should be 127.0.0.1, application should be 0.0.0.0.

Default AMP IP Binding : 127.0.0.1
Default Application IP Binding : 0.0.0.0
Docker External IP : 172.31.10.62 and was also trying with
Docker External IP : 0.0.0.0
Instance Security & Privacy Server IP : 172.31.10.62

If I check the docker image (via portainer) I only see the “host” network without an IP address.
So it seems, this container has no ip-adress…and also no connection from the Valheim Client.

Did also some tests with MC Bedrock:
Default AMP IP Binding : 127.0.0.1
Default Application IP Binding : 0.0.0.0
Docker External IP : 0.0.0.0

1st Instance / Server Settings / Server IP Address 172.31.10.61
2nd Instance / Server Settings / Server IP Address 172.31.10.62

2nd instance not starting, because of already used port. Both instances on 172.31.10.60

I need to use different ports with the result that the server NOT using default port is not in the friend-list of the MC Bedrock client. So I have to setup an internal MC -port-forwarding-proxy or configure it manualy in every bedrock client :frowning:

It seems, AMP is just ignoring all IP settings and propagate ALL servers on the first IP.

i will now install a new linux server with one nic and one ip address, because i have the impression that AMP cannot work with more than one ip address…which is very disappointing and has cost me a lot of my life time :frowning:

Update : New Ubuntu Server with ONE single IP, installing AMP and a Valheim instance, was able to connect at the first try…

Why there is even an option to change IP’s in AMP if its not working at all ?

You’re trying to do too many things at once. Stop and slow down, following the instructions one at a time.

The settings for the default application IP binding only applies to newly created instances, not to existing ones.

AMP itself doesn’t handle IP pools so each server will need it’s configuration manually changing. You also won’t be able to use the same port on multiple IPs. For Minecraft servers you can use SRV records to avoid the client having to specify the port though.

As it currently stands there isn’t much benefit to using multiple IP addresses with AMP right now because ports are assumed to be consumed globally.