Score:-1

Ports closed remotely while they are open locally

pt flag

i have a problem with a mariaDB server, the port is locally open, but on a remote desktop, the port appears closed.

 Port       Status    service
3306/tcp     open      mysql

^^^^ localhost output

Port 3306 is closed on (my IP)

^^^^ remote desktop

Also when i try to open new ports, for example port 123 for a web based game using mode.js, the same thing happens.

Firewall is inactive

All that happened after i once rebooted my vps.

Thank You!

Score:2
in flag

One thing to check if which address it listens on, use netstat -anp | grep 3306 if it is 0.0.0.0:3306 then anyone can connect, however if it is 127.0.0.1:3306 then you can only connect to it via localhost.

To change what MariaDb listen on, change my.cnf and comment out bind-address line, which will make it listen on all interfaces, see documentation

Also check iptables iptables -vnL

Some things that you should provide in original post is which commands you used to obtain the output. And also more details about the network, where is the server that you try to connect to in relation to where the client is located, is it on the same local network, or is there something else in-between?

kuba42 avatar
pt flag
When im running the netstat command you provided, there are 127.0.0.1 ip's. The machine im trying to connect to is a VPS, so im trying to connect to a while another network. The question is now, How can i change the ip's to 0.0.0.0 on mariaDB?
kuba42 avatar
pt flag
The other thing is, when i try to open ports for another web server, i also can't connect to it. (It worked fine before i did the reboot)
in flag
Then it only listens on localhost, see edit on how to modify my.cnf to change this. Also remember both the machine, and the hosting can have firewalls, leaving out these details makes it harder to answer.
kuba42 avatar
pt flag
Hey, sorry for a late answer, im sure its not the firewall problem. Im trying to edit 50-server.cnf in etc/MySQL/mariadb.conf.d/ as its mariadb, im uncommenting and changing the bind address to 0.0.0.0, after rebooting my vps it still listens to 127.0.0.1.
kuba42 avatar
pt flag
And the iptables command you told me to run, is giving me a bunch of 0.0.0.0 docker ips
kuba42 avatar
pt flag
Also, as i said before, all that was working fine before i rebooted my vps. Now i can not even connect to a single service that worked fine before,
in flag
the `iptables` output IS firewall (in hosting there can be multiple layers), check if you have any `DROP` or `REJECT` lines, since that could give similar symptoms. you can use the `netstat` command to check the other services as well. Debugging these issues are all about pinpointing where the issue is, and then be able to solve it - (premature conclusions is one of the enemies), check every step in a bisecting manner. Since you have told us so little about your setup it's hard to help. `netstat` can show you the PID of mariadb, `ps aux could show you the cmdline of that process.
kuba42 avatar
pt flag
Chain DOCKER-ISOLATION-STAGE-2 (1 references) pkts bytes target prot opt in out source destination 0 0 DROP all -- * docker0 0.0.0.0/0 0.0.0.0/0
kuba42 avatar
pt flag
NiKiZe, i dont really know much about it, do you maybe have some communication app like discord where we could talk about it please?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.