How to prevent connection to the server from the server IP?

  • 0
    Hello. We have a small game hosting. There is a modification that launches bots on the server (it is located on our equipment), while from the same server (that is, the same IP of the server and incoming connections, bots).
    How can you limit this? With some rules. We will be glad to help.
    Ubuntu Anonymous, Mar 12, 2020

  • 1 Answers
  • 0
    iptables -I INPUT -s 11.22.33.44 -p tcp --dport 5566 -j DROP
    iptables -I INPUT -s 11.22.33.44 -p udp --dport 5566 -j DROP
    iptables -I INPUT -s 127.0.0.1/8 -p tcp --dport 5566 -j DROP
    iptables -I INPUT -s 127.0.0.1/8 -p udp --dport 5566 -j DROP


    here 11.22.33.44 - server IP address

    5566 - port number (if only UDP or TCP is used, then remove two unnecessary rules).
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!