If the problem is related to a remote access, here is the solution for anyone who has the problem
show iptable rules line numbers
sudo iptables -L --line-numbers
The output will be something like this
num target prot opt source destination
1 ACCEPT all -- anywhere anywhere ctstate RELATED,...