Portál AbcLinuxu, 12. května 2025 15:47
Zdravím, dostal se mi do ruky takový firewall postavený na několika bash scriptech pracující s iptables.
Všechny soubory fungují správně až na jeden, ten mi vypíše tyto chyby:
/usr/local/etc/firewall/firewall: line 14: -F: command not found
/usr/local/etc/firewall/firewall: line 15: -X: command not found
/usr/local/etc/firewall/firewall: line 17: -A: command not found
/usr/local/etc/firewall/firewall: line 18: -A: command not found
/usr/local/etc/firewall/firewall: line 20: -A: command not found
/usr/local/etc/firewall/firewall: line 21: -A: command not found
/usr/local/etc/firewall/firewall: line 22: -A: command not found
/usr/local/etc/firewall/firewall: line 23: -A: command not found
/usr/local/etc/firewall/firewall: line 26: -P: command not found
/usr/local/etc/firewall/firewall: line 27: -P: command not found
/usr/local/etc/firewall/firewall: line 28: -P: command not found
/usr/local/etc/firewall/firewall: line 31: -A: command not found
/usr/local/etc/firewall/firewall: line 32: -A: command not found
Zde je úryvek z tohoto souboru (hlavně tedy ty řádky, na kterých je command not found)
$IPTABLES -F $IPTABLES -X
$IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p tcp
$IPTABLES -A OUTPUT -j ACCEPT -m state --state ESTABLISHED -o eth0 -p tcp
$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp --dport 22 -j ACCEPT
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
$IPTABLES -P FORWARD DROP
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A FORWARD -i lo -j ACCEPT
Kde je chyba? Nemohu na to přijít. Díky
Nad těmi pravidly v tom soubory je ještě toto:
iptables=/sbin/iptables
case sensitive?
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.