--limit 10 -j ACCEPT # Sure, let's reply to pings.
${IPTABLES} -A INPUT --dst ${EXTERNAL_IP} -m state \
--state INVALID -j DROP # We don't want any invalid packets.
${IPTABLES} -A INPUT --dst ${EXTERNAL_IP} -m state \
--state ESTABLISHED,RELATED -j ACCEPT # Only connections that were initiated from the inside.
${IPTABLES} -A INPUT --src ${INTERNAL_IP} -j ACCEPT # Accept connections from the LAN.
## Filters configured ##
# Make all outbound packets look like they are coming from one IP
${IPTABLES} -t nat -A POSTROUTING -o ${EXTERNAL_IFACE} -j MASQUERADE
# Enable packet forwarding
echo "1" > /proc/sys/net/ipv4/ip_forward
We use cookies to provide, improve, protect and promote our services. Visit our Privacy Policy and Privacy Policy FAQs to learn more. You can manage your personal preferences, including your ‘Do not sell or share my personal data to third parties’ setting using the “Customize cookies” button below.