Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- # enable IP forwarding
- echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
- echo 1 > /proc/sys/net/ipv4/conf/default/forwarding
- echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
- echo 1 > /proc/sys/net/ipv6/conf/default/forwarding
- echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
- echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter
- iptables -F
- iptables -t nat -F
- iptables -P INPUT ACCEPT
- iptables -P OUTPUT ACCEPT
- iptables -P FORWARD ACCEPT
- iptables -A FORWARD -i eth0 -s 172.31.54.0/255.255.255.0 -j ACCEPT
- iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- iptables -A INPUT -p icmp --icmp-type 8 -j DROP
- ip6tables -A INPUT -p ipv6-icmp --icmpv6-type 8 -j DROP
- iptables -A INPUT -p tcp --destination-port 53 -j ACCEPT
- iptables -A INPUT -p udp --destination-port 53 -j ACCEPT
- iptables -A INPUT -p tcp --destination-port 80 -j ACCEPT
- iptables -A INPUT -p udp --destination-port 80 -j ACCEPT
- ip6tables -A INPUT -p tcp --destination-port 53 -j ACCEPT
- ip6tables -A INPUT -p udp --destination-port 53 -j ACCEPT
- ip6tables -A INPUT -p tcp --destination-port 80 -j ACCEPT
- ip6tables -A INPUT -p udp --destination-port 80 -j ACCEPT
- iptables -A INPUT -p tcp --destination-port 1:65535 -j DROP
- iptables -A INPUT -p udp --destination-port 1:65535 -j DROP
- ip6tables -A INPUT -p tcp --destination-port 1:65535 -j DROP
- ip6tables -A INPUT -p udp --destination-port 1:65535 -j DROP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement