First page Back Continue Last page Overview Graphics
SSH & HTTPD
On my gateway machine, I run OpenSSH (sshd) so I can connect to it remotely. Add these rules to allow SSH traffic through the firewall:
iptables -A INPUT -i eth0 -p tcp -d 0/0 --dport 22 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -d 0/0 --dport 2222 -j ACCEPT
Note that the second rule is for the portfw ssh on my internal server.
I also run the Apache Web Server (httpd) on my gateway, so I need to allow it as well. Also, I want to allow other web servers to send me content that I've asked for in a browser on ports 80 & 443 (http/https). Add these rules to let this http traffic through:
iptables -A INPUT -i eth0 -p tcp -s 0/0 --sport 80 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -s 0/0 --sport 443 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -d 0/0 --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -d 0/0 --dport 443 -j ACCEPT
Again, 4 rules, the first two are line wrapped.
Notes: