View previous topic :: View next topic |
Author |
Message |
porfiao n00b
Joined: 16 May 2007 Posts: 25
|
Posted: Wed Jul 11, 2007 8:50 pm Post subject: Problema para configurar iptables....uff |
|
|
iptables v1.3.5: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
mas de un dolor de cabeza para poder configurar un kernel con iptables. tengo un kernel 2.6.20-r8 y no se y tampoco e podido encontrar como configurar un firewall con este kernel.. ¿alguien seria tan amable de echarme una manito(ayuda)? |
|
Back to top |
|
|
jgascon Apprentice
Joined: 08 Dec 2006 Posts: 252
|
Posted: Wed Jul 11, 2007 9:17 pm Post subject: |
|
|
Lo que te está diciendo iptables es que no has cargado el módulo para la tabla filter, prueba a hacer:
Code: |
modprobe ip_tables
modprobe iptable_filter
|
Si no te funciona el modprobe puede que no hayas compilado el soporte para netfilter. Mírate esta página, a mi me fue muy bien |
|
Back to top |
|
|
porfiao n00b
Joined: 16 May 2007 Posts: 25
|
Posted: Thu Jul 12, 2007 12:56 pm Post subject: |
|
|
jgascon wrote: | Lo que te está diciendo iptables es que no has cargado el módulo para la tabla filter, prueba a hacer:
Code: |
modprobe ip_tables
modprobe iptable_filter
|
Si no te funciona el modprobe puede que no hayas compilado el soporte para netfilter. Mírate esta página, a mi me fue muy bien |
esto fue lo que hice
tux ~ # modprobe ip_tables
FATAL: Module ip_tables not found.
tux ~ # modprobe iptable_filter
FATAL: Module iptable_filter not found.
tux ~ # zgrep -i netfilter /proc/config.gz
# CONFIG_NETFILTER is not set
tux ~ # grep -i netfilter /usr/src/linux/.config
CONFIG_NETFILTER=y
CONFIG_NETFILTER_DEBUG=y
# Core Netfilter Configuration
# CONFIG_NETFILTER_NETLINK is not set
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
CONFIG_NETFILTER_XT_TARGET_MARK=y
# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
# CONFIG_NETFILTER_XT_MATCH_ESP is not set
# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
# CONFIG_NETFILTER_XT_MATCH_MAC is not set
CONFIG_NETFILTER_XT_MATCH_MARK=y
# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
# CONFIG_NETFILTER_XT_MATCH_REALM is not set
# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
CONFIG_NETFILTER_XT_MATCH_STATE=y
# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
# CONFIG_NETFILTER_XT_MATCH_STRING is not set
# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
# IP: Netfilter Configuration
la verdad es que me guié de la pagina que tu recomiendas pero no me funcionan las cosas como deberían... con la información que te entrego me podrías ayudar...?
gracias... |
|
Back to top |
|
|
jgascon Apprentice
Joined: 08 Dec 2006 Posts: 252
|
Posted: Thu Jul 12, 2007 1:58 pm Post subject: |
|
|
Primero de todo, fíjate que el kernel que estás usando no tiene el soporte de netfilter compilado (cuando haces el zgrep sobre /proc es el kernel en ejecución), pero en cambio si que tienes por ahí un kernel compilado con netfilter (el segundo grep).
porfiao wrote: |
tux ~ # zgrep -i netfilter /proc/config.gz
# CONFIG_NETFILTER is not set
tux ~ # grep -i netfilter /usr/src/linux/.config
CONFIG_NETFILTER=y
|
Rebota la máquina con el kernel que tiene soporte para netfilter. Si no sabes cual es hazle un ls -l a /usr/src/linux/
Code: |
seiya ~ # ls -l /usr/src/linux
lrwxrwxrwx 1 root root 22 jun 2 01:47 /usr/src/linux -> linux-2.6.20-gentoo-r7
|
Yo normalmente lo que hago con netfilter es compilarlo todo como módulos:
Code: |
networking ->
Networking options --->
[*] Network packet filtering framework (Netfilter) --->
Core Netfilter Configuration --->
# Todo lo que me interesa de aquí como módulo
IP: Netfilter Configuration --->
# Todo lo que me interesa de aquí como módulo
|
Lo único que pierdes al compilar todo esto como módulos es tiempo al compilar y espacio en disco duro, así que merece la pena ser generoso y compilarlo casi todo |
|
Back to top |
|
|
porfiao n00b
Joined: 16 May 2007 Posts: 25
|
Posted: Thu Jul 12, 2007 7:31 pm Post subject: |
|
|
Hice lo que me dijiste y compile todo como módulos....
luego hice esto:
echo "ip_tables" >> /etc/modules.autoload.d/kernel-2.6
echo "iptable_filter" >> /etc/modules.autoload.d/kernel-2.6
pero nada... ahora me sale un error al botear:
failed load modules ip_tables
failed load modules iptables_filter.
y el problema persiste... ¿?¿?¿?¿?¿?¿?¿?¿ |
|
Back to top |
|
|
jgascon Apprentice
Joined: 08 Dec 2006 Posts: 252
|
Posted: Thu Jul 12, 2007 8:00 pm Post subject: |
|
|
A mí lo único que se me ocurre es que no estás arrancando con el kernel en el que has compilado el soporte para netfilter. Pégame aquí las salidas de:
Code: |
zgrep -i netfilter /proc/config.gz
grep -i netfilter /usr/src/linux/.config
ls -l /usr/src/linux
uname -a
eselect kernel list
|
|
|
Back to top |
|
|
porfiao n00b
Joined: 16 May 2007 Posts: 25
|
Posted: Fri Jul 13, 2007 12:49 pm Post subject: |
|
|
jgascon wrote: | A mí lo único que se me ocurre es que no estás arrancando con el kernel en el que has compilado el soporte para netfilter. Pégame aquí las salidas de:
Code: |
zgrep -i netfilter /proc/config.gz
grep -i netfilter /usr/src/linux/.config
ls -l /usr/src/linux
uname -a
eselect kernel list
|
|
tux ~ # zgrep -i netfilter /proc/config.gz
# CONFIG_NETFILTER is not set
tux ~ # grep -i netfilter /usr/src/linux/.config
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
# Core Netfilter Configuration
# CONFIG_NETFILTER_NETLINK is not set
CONFIG_NETFILTER_XTABLES=m
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
CONFIG_NETFILTER_XT_TARGET_MARK=m
# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
# CONFIG_NETFILTER_XT_MATCH_ESP is not set
# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
# CONFIG_NETFILTER_XT_MATCH_MAC is not set
CONFIG_NETFILTER_XT_MATCH_MARK=m
# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
# CONFIG_NETFILTER_XT_MATCH_REALM is not set
# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
CONFIG_NETFILTER_XT_MATCH_STATE=m
# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
# CONFIG_NETFILTER_XT_MATCH_STRING is not set
# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
# IP: Netfilter Configuration
tux ~ # ls -l /usr/src/linux
lrwxrwxrwx 1 root root 22 Jul 3 13:30 /usr/src/linux -> linux-2.6.20-gentoo-r8
tux ~ # uname -a
Linux tux 2.6.19-gentoo-r5 #8 SMP Tue Jun 5 21:40:49 GMT 2007 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz GNU/Linux
tux ~ # eselect kernel list
Available kernel symlink targets:
[1] linux-2.6.20-gentoo-r8 *
tux ~ # |
|
Back to top |
|
|
jgascon Apprentice
Joined: 08 Dec 2006 Posts: 252
|
Posted: Fri Jul 13, 2007 2:31 pm Post subject: |
|
|
porfiao wrote: |
tux ~ # zgrep -i netfilter /proc/config.gz
# CONFIG_NETFILTER is not set <-- El kernel que estás ejecutando no tiene el soporte para netfilter
tux ~ # grep -i netfilter /usr/src/linux/.config
CONFIG_NETFILTER=y <- el kernel que estás compilando sí tiene soporte para netfilter
tux ~ # ls -l /usr/src/linux
lrwxrwxrwx 1 root root 22 Jul 3 13:30 /usr/src/linux -> linux-2.6.20-gentoo-r8 <-El enlace está bien apunta al kernel nuevo
tux ~ # uname -a
Linux tux 2.6.19-gentoo-r5 #8 SMP Tue Jun 5 21:40:49 GMT 2007 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz GNU/Linux <-Esto está mal, estás arrancando con el kernel viejo
|
Hola, porfiao por lo que deduzco por las salidas que me has pegado estás arrancando con un kernel 2.6.19 que no tiene soporte para iptables y estás compilando el soporte para iptables para un kernel 2.6.20. Lo que tienes que hacer es modificar el gestor de arranque (grub o lilo) para arrancar con el kernel 2.6.20.
Mírate está guía a ver si te ayuda. Espero que con esto puedas salir adelante |
|
Back to top |
|
|
porfiao n00b
Joined: 16 May 2007 Posts: 25
|
Posted: Fri Jul 13, 2007 3:23 pm Post subject: |
|
|
Hola gracias por tu ayuda...
corrigeme si me equivoco
# Partición donde se encuentra la imagen del kernel (o sistema operativo)
root (hd0,0)
kernel /boot/kernel-2.6.19-gentoo-r5 --> imagen del kernel
root=/dev/sda3
tux ~ # ls -l /boot/
total 2080
-rw-r--r-- 1 root root 2121872 Jul 12 19:21 kernel-2.6.19-gentoo-r5
tux ~ # ls -l /usr/src/linux
lrwxrwxrwx 1 root root 22 Jul 3 13:30 /usr/src/linux -> linux-2.6.20-gentoo-r8
tux ~ # ls -l /usr/src/
total 4
lrwxrwxrwx 1 root root 22 Jul 3 13:30 linux -> linux-2.6.20-gentoo-r8
drwxr-xr-x 20 root root 4096 Jul 12 19:21 linux-2.6.20-gentoo-r8
----------------------aparte
cuando yo compilo el kernel hago lo siguiente
1).- compilado [OK]
2).- tux linux # cp arch/i386/boot/bzImage /boot/kernel-2.6.19-gentoo-r5 --> donde este solamente es el nombre del archivo pero lo que contiene deberia ser el kernel 2.6.20
es asi o no???? |
|
Back to top |
|
|
jgascon Apprentice
Joined: 08 Dec 2006 Posts: 252
|
Posted: Fri Jul 13, 2007 4:00 pm Post subject: |
|
|
porfiao wrote: |
1).- compilado [OK]
2).- tux linux # cp arch/i386/boot/bzImage /boot/kernel-2.6.19-gentoo-r5 --> donde este solamente es el nombre del archivo pero lo que contiene deberia ser el kernel 2.6.20
es asi o no???? |
Pues la verdad es que a eso no te puedo contestar porque no lo sé. Lo más normal es que al copiar el bzImage le cambies el nombre al kernel que estás compilando, más que nada para evitar confusiones. En teoria tienes razón, el nombre no tiene porque variar el contenido.
Para sacarnos de dudas ejecuta lo siguiente sobre tu kernel, (si quieres haz una copia antes):
Code: |
/usr/src/linux/scripts/extract-ikconfig /boot/TU-KERNEL | grep 'Linux kernel'
|
Yo lo he ejecutado sobre un kernel 2.6.18 al que había rebautizado como 2.4.18 y me ha dado la información correcta
Code: |
cerbero linux # /usr/src/linux/scripts/extract-ikconfig /boot/2.4.18 | grep 'Linux kernel'
# Linux kernel version: 2.6.18-hardened-r6
|
He encontrado esto en tldp[1]:
Quote: |
config IKCONFIG
bool "Soporte para .config dentro del núcleo"
---help---
Esta opción incluye el contenido completo del fichero «.config» de
configuración del núcleo Linux, información del compilador que se
ha usado para construir el núcleo, el núcleo que se estaba
ejecutando cuando se construyó este núcleo y la versión del núcleo
del Makefile, directamente grabada en el núcleo. Permite saber qué
opciones del núcleo se están usando en un núcleo que esté
funcionando o que esté simplemente en disco. Esta información
puede extraerse con el script scripts/extract-ikconfig y ser así
usada como entrada para reconstruir un núcleo idéntico o para
compilar otro. También se puede extraer de un núcleo en operación
leyendo /proc/config.gz y /proc/config_built_with, si están
activados (ver más abajo). /proc/config.gz mostrará la configuración
que se usó para compilar el núcleo y /proc/config_built_with dará
información del compilador y máquina usados para construir tal
núcleo.
|
[1] http://es.tldp.org/NuLies/web/2.6/init/Kconfig |
|
Back to top |
|
|
|