firmware/bsp/default/root_file_system/etc/firewall.user
Tim Niemeyer 3622ea8cb5 wan-firewall: fix and clean up
- use -A (append) instead of -I (insert)
This makes shure the rule order is correct. This fixes #421.
- use uci to determine the correct wan interface
This is the reason, why #421 was only on wr1043. Now the firewall rule
applies to all router.
- remove old and not used rules

Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
2012-11-17 18:20:52 +01:00

11 lines
410 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
#solves MTU problem with bad ISP´s
iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
# Wenn ein router direkt am Netz hängt, ist er auch ssh Angriffen ausgesetzt.
# Das wirkt bei kleinen Geräten wir ein DOS
WAN=$(uci get network.wan.ifname)
iptables -A INPUT -i $WAN -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i $WAN -j REJECT