# bestehende Verbindungen$IPT -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# Über Loopback alles erlauben
$IPT -I INPUT -i lo -j ACCEPT
$IPT -I OUTPUT -o lo -j ACCEPT
# SSH
$IPT -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
# OSCAM WEB
$IPT -A INPUT -i eth0 -p tcp --dport 144 -j ACCEPT
# CCCAM
#$IPT -A INPUT -i eth0 -p tcp --dport 12000 -j ACCEPT
# CCCAM WEB
#$IPT -A INPUT -i eth0 -p tcp --dport 16001 -j ACCEPT
# CS378X
#$IPT -A INPUT -i eth0 -p tcp --dport 12345-j ACCEPT
# CAMD35
#$IPT -A INPUT -i eth0 -p udp --dport 12345-j ACCEPT
Chain INPUT (policy ACCEPT)target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:144
ACCEPT tcp -- anywhere anywhere tcp dpt:12000
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
DROP icmp -- anywhere anywhere icmp echo-request
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
#!/bin/sh### BEGIN INIT INFO
# Provides: custom firewall
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: firewall initscript
# Description: Custom Firewall
### END INIT INFO
IPT=/sbin/iptables
case "$1" in
start)
# bestehende Verbindungen
$IPT -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# ▒^▒ber Loopback alles erlauben
$IPT -I INPUT -i lo -j ACCEPT
$IPT -I OUTPUT -o lo -j ACCEPT
# SSH
$IPT -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
# OSCAM WEB
#$IPT -A INPUT -i eth0 -p tcp --dport 16002 -j ACCEPT
# CCCAM
#$IPT -A INPUT -i eth0 -p tcp --dport 12000 -j ACCEPT
# CCCAM WEB
#$IPT -A INPUT -i eth0 -p tcp --dport 16001 -j ACCEPT
# CS378X
#$IPT -A INPUT -i eth0 -p tcp --dport 12345-j ACCEPT
# CAMD35
#$IPT -A INPUT -i eth0 -p udp --dport 12345-j ACCEPT
# PING SPERRE
#$IPT -A INPUT -i eth0 -j REJECT
# SICHERHEIT
$IPT -A INPUT -p icmp -m icmp --icmp-type 8 -j DROP
$IPT -A FORWARD -p tcp --syn -m limit --limit 1/s -j ACCEPT
$IPT -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT
$IPT -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s
echo "Firewall wurde aktiviert, der Server ist geschützt"
exit 0
;;
stop)
$IPT -F INPUT
echo "Achtung, Firewall wurde gestoppt, der Server ist ungeschützt"
exit 0
;;
restart|reload|force-reload)
$0 stop
sleep 1
$0 start
exit 0
;;
iptables -LChain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
DROP icmp -- anywhere anywhere icmp echo-request
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
icmp -- anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Das Ausrauten ist mir schon klar...gib mal ifconfig ein und poste das Ergebnis
ahja und du hast im script überall am anfang ein "#" dies bedeutet das der Befehl auskommentiert ist und diese Zeile wird dann nicht ausgeführt
eth0 Link encap:Ethernet HWaddr 00:12:34:56:78:9a inet addr:xx.xxx.xxx.xx Bcast:xx.xx.xx.255 Mask:255.255.255.0
inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/xx Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:633761 errors:0 dropped:435 overruns:0 frame:0
TX packets:20501 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:273333064 (260.6 MiB) TX bytes:2533890 (2.4 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Chain INPUT (policy ACCEPT)target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:1234 #Mein geänderter SSH Port
ACCEPT icmp -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[I]# PING SPERRE
$IPT -A INPUT -i eth0 -j REJECT[/I]
# SICHERHEIT
$IPT -A INPUT -p icmp -m icmp --icmp-type 8 -j DROP
[I]$IPT -A INPUT -i eth0 -j REJECT[/I]
Wir verwenden Cookies und ähnliche Technologien für folgende Zwecke:
Akzeptieren Sie Cookies und diese Technologien?
Wir verwenden Cookies und ähnliche Technologien für folgende Zwecke:
Akzeptieren Sie Cookies und diese Technologien?