On 25/12/22 10:14, Piperみかこ wrote:
Hello,

I have setup the following iptables on linux server,

sudo /usr/sbin/iptables -F
sudo /usr/sbin/iptables -A INPUT -s 127.0.0.1 -j ACCEPT
sudo /usr/sbin/iptables -A INPUT -s xx.xx.xx.xx -j ACCEPT  # my server public IP
sudo /usr/sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT
sudo /usr/sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo /usr/sbin/iptables -A INPUT -p tcp -j DROP

These rules work for incoming connections.
But if I made a request from this server box to the external server, such as rsync to another remote server, it won't work.

So how can I set up the outgoing rules as well?

Thanks and happy holidays~

Piper


It's not quite clear what you are doing. I guess your linux box is in your LAN and you have an external server on the internet?

Anyway, it's usual to have a line like this to handle handshaking with external systems.

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

--
Jeremy

Reply via email to