trotz funktion von iptables script krieg ich eine fehler meldung / fehler beim Neusten kernel
Posted: 2006-09-28 19:58
mein vorheriges script habe ich output geöffnet und nur bei input auf drop eingestellt und die nötigen ports geöffnet.
habe nun mein script umgeschrieben und erweitert.
wenn ich meine script ausführe funktioniert auch iptables nur ich kriege immer diese meldung:
/etc/init.d/iptables_script start
iptables: No chain/target/match by that name
und wenn ich das script deaktiviere:
/etc/init.d/iptables_script stop
iptables: Bad built-in chain name
hab nen neuen kernel installiert (2.6.17.3), beim dem standard mitgelieferten Kernel (2.6.14-2-k7-smp) habe ich auch die gleichen fehler.
Es Handelt sich um einen root server von server4you.
Aktivierte funktionen
TCP syncookie support (aktiviert)
und alle funktionen unter
Networking --->
Networking options --->
[*] Network packet filtering (replaces ipchains) --->
[*] Network packet filtering debugging
[*] Bridged IP/ARP packets filtering
Core Netfilter Configuration --->
IP: Netfilter Configuration --->
IPv6: Netfilter Configuration (EXPERIMENTAL) --->
DECnet: Netfilter Configuration --->
Bridge: Netfilter Configuration --->
da wurde auch alles aktiviert.
Dazu habe ich noch einige funktionen aktiviert die ich brauche für den gameserver solange die noch nicht aktiv waren.
Device Drivers --->
Block devices --->
<*> RAM disk support
(16) Default number of RAM disks
(8192) Default RAM disk size (kbytes)
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
File systems --->
Miscellaneous filesystems --->
<*> Compressed ROM file system support (cramfs)
Processor type and features --->
Preemption Model (Preemptible Kernel (Low-Latency Desktop))
[*] Preempt The Big Kernel Lock
Processor type and features --->
Timer frequency (1000 HZ)
General Setup --->
[*] Kernel .config support
[*] Enable acess to .config through /proc/config.gz
aktuelles iptables script:
vorhes script (da gab es keine fehler):
-------------------------------------------------------------------
probleme beim erstellen des kernels 2.6.18
fehler ensteht bei complimieren
fehlermeldung:
vorgang:
cd /usr/src
wget ...
tar xjvf linux-2.6.18.tar.bz2
ln -s linux-2.6.18 linux
cd linux
aptitude install ncurses-dev kernel-package
make menuconfig (alte config laden und alle nötigen funktionen
aktivieren)
make-kpkg clean
make-kpkg --revision=custom.1.0 --initrd kernel_image
und danach neuen kernel installieren und im bootmanager einfügen.
am ende noch ein neustart.
habe nun mein script umgeschrieben und erweitert.
wenn ich meine script ausführe funktioniert auch iptables nur ich kriege immer diese meldung:
/etc/init.d/iptables_script start
iptables: No chain/target/match by that name
und wenn ich das script deaktiviere:
/etc/init.d/iptables_script stop
iptables: Bad built-in chain name
hab nen neuen kernel installiert (2.6.17.3), beim dem standard mitgelieferten Kernel (2.6.14-2-k7-smp) habe ich auch die gleichen fehler.
Es Handelt sich um einen root server von server4you.
Aktivierte funktionen
TCP syncookie support (aktiviert)
und alle funktionen unter
Networking --->
Networking options --->
[*] Network packet filtering (replaces ipchains) --->
[*] Network packet filtering debugging
[*] Bridged IP/ARP packets filtering
Core Netfilter Configuration --->
IP: Netfilter Configuration --->
IPv6: Netfilter Configuration (EXPERIMENTAL) --->
DECnet: Netfilter Configuration --->
Bridge: Netfilter Configuration --->
da wurde auch alles aktiviert.
Dazu habe ich noch einige funktionen aktiviert die ich brauche für den gameserver solange die noch nicht aktiv waren.
Device Drivers --->
Block devices --->
<*> RAM disk support
(16) Default number of RAM disks
(8192) Default RAM disk size (kbytes)
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
File systems --->
Miscellaneous filesystems --->
<*> Compressed ROM file system support (cramfs)
Processor type and features --->
Preemption Model (Preemptible Kernel (Low-Latency Desktop))
[*] Preempt The Big Kernel Lock
Processor type and features --->
Timer frequency (1000 HZ)
General Setup --->
[*] Kernel .config support
[*] Enable acess to .config through /proc/config.gz
aktuelles iptables script:
Code: Select all
#!/bin/sh
case "$1" in
start|restart)
#Regeln löschen
iptables -F
#Loopback
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
#Server-dineste
#SSH-server
iptables -A INPUT -p TCP -s 0/0 --sport 1024:65535 -d 0/0 --dport 22 -i eth0 -j ACCEPT
iptables -A OUTPUT -p TCP -d 0/0 --dport 1024:65535 -s 0/0 --sport 22 -o eth0 -j ACCEPT
#Apache2 & zugriff auf fremde Webserver
iptables -A INPUT -p TCP -d 0/0 --dport 80 -s 0/0 --sport 1024:65535 -j ACCEPT
iptables -A OUTPUT -p TCP -s 0/0 --sport 80 -d 0/0 --dport 1024:65535 -j ACCEPT
iptables -A OUTPUT -p TCP -d 0/0 --dport 80 -s 0/0 --sport 1024:65535 -o eth0 -j ACCEPT
iptables -A INPUT -p TCP -s 0/0 --sport 80 -d 0/0 --dport 1024:65535 -m state
--state RELATED,ESTABLISHED -i eth0 -j ACCEPT
#FTP server & Augehende verbindung zu FTP Server - passiver modus
#Ausgehende verbindungen
iptables -A OUTPUT -p TCP -d 0/0 --dport 21 -s 0/0 --sport 1024:65535 -j ACCEPT
iptables -A INPUT -p TCP -s 0/0 --sport 21 -d 0/0 --dport 1024:65535 -m state --state
RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p TCP -d 0/0 --dport 1024:65535 -s 0/0 --sport 1024:65535 -j ACCEPT
iptables -A INPUT -p TCP -d 0/0 --dport 1024:65535 -s 0/0 --sport 1024:65535 -m state --state
RELATED,ESTABLISHED -j ACCEPT
#Anfragen auf externe Nameserver
iptables -A OUTPUT -p UDP -d 0/0 --dport 53 -s 0/0 --sport 1024:65535 -j ACCEPT
iptables -A OUTPUT -p TCP -d 0/0 --dport 53 -s 0/0 --sport 1024:65535 -j ACCEPT
iptables -A INPUT -p UDP -s 0/0 --sport 53 -d 0/0 --dport 1024:65535 -m
state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p TCP -s 0/0 --sport 53 -d 0/0 --dport 1024:65535 -m
state --state RELATED,ESTABLISHED -j ACCEPT
#ende
#auth/ident
iptables -A INPUT -p TCP -d 0/0 --dport 113 -j REJECT
#Fragmentation needed and Dont´t Fragment was Set
iptables -A INPUT -p icmp --icmp-type fragmentation-needed -j ACCEPT
iptables -A OUNPUT -p icmp --icmp-type fragmentation-needed -j ACCEPT
#Ping (ausgehene anfragen und eingehende antworten)
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
#Parameter-Problem
iptables -A INPUT -p icmp --icmp-type parameter-problem -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type parameter-problem -j ACCEPT
#Unsinnige Pakete verwerfen
iptables -A INPUT -i eth0 -s 85.25.140.22 -j DROP
iptables -A INPUT -i eth0 -s 127.0.0.0/8 -j DROP
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -p TCP -d 0/0 --dport 3306 -j DROP
iptables -A INPUT -p UDP -d 0/0 --dport 3306 -j DROP
#Default-Policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
;;
stop)
iptables -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FOTWARD ACCEPT
;;
status)
iptables -vL
;;
*)
echo "Fehler /etc/init.d/$0 [start|restart|stop|status]"
esac;
Code: Select all
#!/bin/sh
case "$1" in
start|restart)
# Tabellen leeren
IPTABLES -F
#loopback
IPTABLES -A INPUT -i lo -j ACCEPT
#Bestehende Verbindungen accepten
IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#Port freigaben
#ssh
IPTABLES -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
#Apche
IPTABLES -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
#icmp
#IPTABLES -A INPUT -i eth0 -p icmp -j ACCEPT
#Default forward DROPen / OUTPUT ACCEPT
IPTABLES -P INPUT DROP
IPTABLES -P OUTPUT ACCEPT
IPTABLES -P FORWARD DROP
;;
stop)
IPTABLES -F
IPTABLES -P INPUT ACCEPT
IPTABLES -P OUTPUT ACCEPT
IPTABLES -P FOTWARD ACCEPZ
;;
*)
echo "Fehler /etc/init.d/$0 [start|restart|stop]"
esac;
probleme beim erstellen des kernels 2.6.18
fehler ensteht bei complimieren
fehlermeldung:
Code: Select all
CC arch/i386/lib/strstr.o
CC arch/i386/lib/usercopy.o
AR arch/i386/lib/lib.a
GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
net/built-in.o(.text+0x2ee5b): In function `checkentry':
: undefined reference to `brnf_deferred_hooks'
net/built-in.o(.text+0x2ee8d): In function `checkentry':
: undefined reference to `brnf_deferred_hooks'
make[1]: *** [.tmp_vmlinux1] Fehler 1
make[1]: Leaving directory `/usr/src/linux-2.6.18'
make: *** [stamp-build] Fehler 2
cd /usr/src
wget ...
tar xjvf linux-2.6.18.tar.bz2
ln -s linux-2.6.18 linux
cd linux
aptitude install ncurses-dev kernel-package
make menuconfig (alte config laden und alle nötigen funktionen
aktivieren)
make-kpkg clean
make-kpkg --revision=custom.1.0 --initrd kernel_image
und danach neuen kernel installieren und im bootmanager einfügen.
am ende noch ein neustart.