SSH iptables rule
Can someone please help me to understand why we should set ssh iptables INPUT rule destination port instead of source port?
SSH - iptables -A INPUT -p tcp -s tunnel1private_IP –dport 22 -i eth1 -j ACCEPT
iptables -A INPUT -p tcp -s tunnel1private_IP –sport 22 -i eth1 -j ACCEPT
because for http or https, we set:
iptables -A INPUT -p tcp -s <some-ip-address> –sport 80 -j ACCEPT
iptables -A INPUT -p tcp -s <some-ip-address> –dport 80 -j ACCEPT
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.