mtasa-docker icon indicating copy to clipboard operation
mtasa-docker copied to clipboard

How to select IP to register in serverlist on muli wan machine ?

Open websharik opened this issue 4 years ago • 4 comments

MTA is auto detect and register default gateway as server IP. Any solution to select another IP ?

Example WANs: 77.77.77.1 (eth0), 77.77.77.2 (eth1) Default docker gateway is first eth: 77.77.77.1 So MTA auto detect and register server as 77.77.77.1 How to switch it to 77.77.77.2 ?

-p 77.77.77.2:22003:22003/udp not working, its just tell docker listen input only from eth1, output traffic still be default 77.77.77.1 so MTA still register server as 77.77.77.1

websharik avatar Oct 18 '22 19:10 websharik

I think solution is change output gateway of container, but dont know how do it + mta container require local access to mysql container in same compose.

websharik avatar Oct 18 '22 19:10 websharik

Hi @websharik, can you tell me what are you trying to achieve? It will be easier to help

4O4 avatar Oct 18 '22 20:10 4O4

@4O4 Hi. Im trying use second IP of my machine (with register right ip in mtasa list servers).

By default mta register first ip (default gateway).

websharik avatar Oct 18 '22 21:10 websharik

Okay, the thing is It doesn't matter what IP address MTA binds to inside the container. Docker networks are isolated. Any advanced networking configuration related to external IP addresses should be done on the host OS level, most likely via iptables if you're hosting on Linux. This can't be configured via docker or compose. I don't have any articles on hand that I could link to, but you'll find what you want if you google for iptables and secondary external ip keywords.

You might need to set the desired IP address in your mtaserver.conf though. Maybe that's the missing piece if you have everything else configured.

4O4 avatar Oct 18 '22 22:10 4O4