[network][easy case]troubleshoting the connection to a remote server

HighHill發表於2024-04-11

background & issue

I deployed a minio server on an ECS(a vps in alibaba), but I couldn't access it on local PC. It's an easy case but very common when connecting to a new server. so I record my brief procedure here in case you come into similar situation.

steps how I trouble shot and fix it

  • check the connection
    telnet <ip> <port>
    
    of course it couldn't connect.
  • check the port status is OK on remote server
    netstat -anp | grep <port>
    
    it's healthy.
  • config the 'security group rule' on console(aliyun)
    here I opened all ports for testing convenience. but failed when checking the connectiong again
  • check the firewall in remote server
    login in server and
    sudo ip6tables -L -n -v
    sudo iptables -A INPUT -p tcp --dport <port> -j ACCEPT # add a rule for allowing traffic via <port>
    
    then the connection worked.

相關文章