For personal VPS, simple firewall settings are also necessary, the specific method is as follows:
1. Check that the firewall function is turned on:
#/etc/init.d/iptables Status
2. Set the default policy for input, output, and forward three chains:
# iptables-p INPUT ACCEPT
# iptables-p OUTPUT ACCEPT
# iptables-p FORWARD ACCEPT
3. Clear all pre-defined firewalls:
# iptables-f
# Iptables-x
# iptables-z
4. Set the loopback interface to be unrestricted and then limited:
# iptables-a Input-i lo-j ACCEPT
5. Set up a response packet to open all requests sent by the local machine
# iptables-a input-m state–state related,established-j ACCEPT
6. Set to release the WWW service provided by this machine:
# iptables-a input-p tcp–dport 80-j ACCEPT
7. Set up the SSH service provided by this machine:
# iptables-a input-p tcp–dport 22-j ACCEPT
8. Set the default policy for the input chain to drop:
# iptables-p INPUT DROP
9. Save these routing information:
#/etc/init.d/iptables Save
Note: You need to set the input chain of the default policy for the accept, give yourself a way, lest SSH connection by firewall block, then, can only try to restart the server, or run to the server TTY login. Therefore, the input policy is first set to accept, then the operation of the firewall, and finally execute "iptables-p INPUT DROP".
More wonderful Linux video tutorials at 51CTO Academy: http://edu.51cto.com/course/courseList/id-48.html
Settings for simple firewalls under Linux