This is not a blog, but my notes and tips for research. Feel free to take any information and leave any comments or questions.
Search This Blog
Wednesday, April 10, 2013
iptables setting
# Basic setup
iptables --flush
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP
# Allow SSH
iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 22 -j ACCEPT
# Allow local loopback
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Allow DNS
iptables -A OUTPUT -p udp -o eth0 --dport 53 -j ACCEPT
iptables -A INPUT -p udp -i eth0 --sport 53 -j ACCEPT
# Allow ping
iptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
# Allow http
iptables -A INPUT -i eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
# Allow https
iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
# Printer (ipp=631, cups=515)
iptables -A OUTPUT -p tcp -d 192.168.60.157 --dport 515 -j ACCEPT
iptables -A INPUT -p tcp -s 192.168.60.157 --sport 515 -j ACCEPT
Subscribe to:
Post Comments (Atom)
Labels
- Academic Notes (4)
- BLAS (1)
- CEE618 (2)
- CentOS (1)
- Computation (1)
- Conferences (1)
- Cross compiling (1)
- Graphics (1)
- Hawaii Tour (2)
- Intel compiler (1)
- Just (1)
- Laptop (1)
- LaTex (22)
- Life and Humanity (8)
- Linux and Computing (107)
- LSF (1)
- Lyx (3)
- Macintosh (5)
- MPI (1)
- News (11)
- OpenFoam (1)
- OpenMPI (1)
- PBS (2)
- Software (4)
- SSH (2)
- torque (1)
- Touchpad (1)
- VMD (1)
- yum (1)
No comments:
Post a Comment