All pastes #570734 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-16 21:09 UTC
rendered paste body
#!/bin/bash

echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route

echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses

echo "0" > /proc/sys/net/ipv4/ip_forward

iptables -F
iptables -X
iptables -Z

iptables -P FORWARD DROP

iptables -A INPUT -i eth0 -p ICMP -j ACCEPT

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 443 -m state --state NEW -j ACCEPT

iptables -A INPUT -i eth0 -p tcp -m tcp --dport ssh -m state --state NEW -j ACCEPT

iptables -A INPUT -s thethingie.dyndns.com -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT




iptables -A INPUT   -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -m state --state INVALID,NEW -j DROP