View previous topic :: View next topic |
Author |
Message |
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Thu Dec 04, 2014 5:06 am Post subject: Firewall UFW no trabaja [SOLVED] |
|
|
Hola genturiones!!
Vengo intentando hacer andar el ufw, pero me hace sufrir bastante.
Lo instalé como indica la wiki y agregué los elementos en el kernel que venían apareciendo en el emerge y todavía no lo puedo hacer andar correctamente.
Uno de los errores que tengo es este:
Code: | # ufw default deny
ERROR: problem running ufw-init
iptables-restore: line 4 failed
iptables-restore: line 69 failed
iptables-restore: line 47 failed
ip6tables-restore: line 4 failed
ip6tables-restore: line 65 failed
ip6tables-restore: line 47 failed
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/user/user.rules'
Problem running '/etc/ufw/before6.rules'
Problem running '/etc/ufw/user/user6.rules'
|
Busqué en otros foros pero no di con la solución. Otra cosa que me pasa es que para agregar las reglas corro lo siguiente:
Code: | ufw allow in http
ufw allow in https
ufw allow ssh
ufw allow ftp
ufw allow in 17500 |
Las reglas las acepta bien, aun así no puedo entrar a ninguna web mientras el ufw esté andando.
Alguien me puede dar una mano con esto?
Les aviso que es mi primer fw en gentoo y no conozco demasiado del tema.
Gracias!!!
Last edited by natrix on Wed Dec 24, 2014 3:39 am; edited 1 time in total |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Thu Dec 04, 2014 3:32 pm Post subject: |
|
|
¿Has ejecutado los comandos necesarios para la primera ejecución de iptables?
Code: | (root)# rc-service iptables save
(root)# rc-service iptables start |
|
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Thu Dec 04, 2014 11:59 pm Post subject: |
|
|
Gracias quilosaq!
No, no lo había hecho pero tampoco funciona, esta es mi salida:
Code: | # rc-service iptables start
* WARNING: iptables is already starting
# rc-service iptables save
* Saving iptables state ... |
Por si sirve de algo, esta es mi salida de systemd:
Code: | # systemctl status ip*
● ip6tables-store.service - Store ip6tables firewall rules
Loaded: loaded (/usr/lib64/systemd/system/ip6tables-store.service; enabled)
Active: inactive (dead)
● iptables-store.service - Store iptables firewall rules
Loaded: loaded (/usr/lib64/systemd/system/iptables-store.service; enabled)
Active: inactive (dead)
● iptables-restore.service - Restore iptables firewall rules
Loaded: loaded (/usr/lib64/systemd/system/iptables-restore.service; enabled)
Active: inactive (dead) since jue 2014-12-04 20:52:27 ART; 2min 47s ago
Process: 2733 ExecStart=/sbin/iptables-restore /var/lib/iptables/rules-save (code=exited, status=0/SUCCESS)
Main PID: 2733 (code=exited, status=0/SUCCESS)
● ip6tables-restore.service - Restore ip6tables firewall rules
Loaded: loaded (/usr/lib64/systemd/system/ip6tables-restore.service; enabled)
Active: inactive (dead) since jue 2014-12-04 20:52:27 ART; 2min 48s ago
Process: 2734 ExecStart=/sbin/ip6tables-restore /var/lib/ip6tables/rules-save (code=exited, status=0/SUCCESS)
Main PID: 2734 (code=exited, status=0/SUCCESS)
|
Code: | # systemctl status iptables
● iptables.service - Store and restore iptables firewall rules
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)
dic 04 20:53:55 natrix systemd[1]: iptables.service lacks ExecStart setting. Refusing.
dic 04 21:02:20 natrix systemd[1]: iptables.service lacks ExecStart setting. Refusing.
dic 04 21:02:38 natrix systemd[1]: iptables.service lacks ExecStart setting. Refusing. |
Alguna idea? |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Fri Dec 05, 2014 2:41 pm Post subject: |
|
|
¿Que dice Code: | (root)# /sbin/iptables-restore /var/lib/iptables/rules-save | ? |
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Fri Dec 05, 2014 3:09 pm Post subject: |
|
|
En la consola no salta nada, nada! |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Fri Dec 05, 2014 3:15 pm Post subject: |
|
|
Pues debería funcionar Code: | (root)# systemctl start ufw | o al menos Code: | (root)#systemctl start iptables |
|
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Fri Dec 05, 2014 5:03 pm Post subject: |
|
|
quilosaq, gracias por tu tiempo:
Code: | # systemctl start ufw | nada más
Code: | # systemctl start iptables
Failed to start iptables.service: Unit iptables.service failed to load: Invalid argument. See system logs and 'systemctl status iptables.service' for details. |
Code: | # systemctl status iptables.service
● iptables.service - Store and restore iptables firewall rules
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)
dic 05 13:58:30 natrix systemd[1]: iptables.service lacks ExecStart setting. Refusing.
dic 05 13:59:48 natrix systemd[1]: iptables.service lacks ExecStart setting. Refusing.
|
En mi journal:
Code: | systemd[1]: ufw.service: main process exited, code=exited, status=1/FAILURE
dic 05 13:56:30 natrix systemd[1]: Failed to start Uncomplicated Firewall.
dic 05 13:56:30 natrix systemd[1]: Unit ufw.service entered failed state.
dic 05 13:56:32 natrix systemd-sysctl[2745]: Overwriting earlier assignment of kernel/sysrq in file '/usr/lib64/sysctl.d/60-gento
dic 05 13:56:40 natrix ufw-init[2499]: Problem running '/etc/ufw/before.rules'
dic 05 13:56:40 natrix ufw-init[2499]: Problem running '/etc/ufw/user/user.rules'
dic 05 13:56:40 natrix ufw-init[2499]: Problem running '/etc/ufw/before6.rules'
dic 05 13:56:40 natrix ufw-init[2499]: Problem running '/etc/ufw/user/user6.rules' |
Manualmente creé lo siguiente como indica la wiki de arch pero tampoco nada:
Code: | # ls /etc/iptables
empty.rules ip6tables.rules iptables.rules |
Last edited by natrix on Sat Dec 06, 2014 2:19 am; edited 1 time in total |
|
Back to top |
|
|
esteban_conde Veteran
Joined: 04 Jun 2003 Posts: 1670
|
Posted: Fri Dec 05, 2014 6:53 pm Post subject: |
|
|
Si quieres que el servicio se inicie en el arranque del sistema el comando es systemctl enable ufw.service luego tienes que reiniciar para ver si en dmesg te da algun mensaje puedes haber cometido algún error de sintaxis en los archivos de configuración _________________ Saludos a tod@s, Esteban. |
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Fri Dec 05, 2014 11:27 pm Post subject: |
|
|
Hola esteban_conde:
Lo del systemctl ya lo revisé. Archivos no llegué a editar ninguno, todavía estoy en lo que es instalación. La salida del journalctl es la misma que ya poste antes.
Por cierto, encontré esto pero no entiendo bien que significa:
Code: | # sh /usr/share/ufw/check-requirements
Has python: pass (binary: python2.7, version: 2.7.7, py2)
Has iptables: pass
Has ip6tables: pass
Has /proc/net/dev: pass
Has /proc/net/if_inet6: pass
This script will now attempt to create various rules using the iptables
and ip6tables commands. This may result in module autoloading (eg, for
IPv6).
Proceed with checks (Y/n)? y
== IPv4 ==
Creating 'ufw-check-requirements'... done
Inserting RETURN at top of 'ufw-check-requirements'... done
TCP: pass
UDP: pass
destination port: pass
source port: pass
ACCEPT: pass
DROP: pass
REJECT: pass
LOG: pass
hashlimit: FAIL
error was: iptables: No chain/target/match by that name.
limit: pass
state (NEW): FAIL
error was: iptables: No chain/target/match by that name.
state (RELATED): FAIL
error was: iptables: No chain/target/match by that name.
state (ESTABLISHED): FAIL
error was: iptables: No chain/target/match by that name.
state (INVALID): FAIL
error was: iptables: No chain/target/match by that name.
state (new, recent set): FAIL (no runtime support)
error was: iptables: No chain/target/match by that name.
state (new, recent update): FAIL (no runtime support)
error was: iptables: No chain/target/match by that name.
state (new, limit): FAIL
error was: iptables: No chain/target/match by that name.
interface (input): pass
interface (output): pass
multiport: pass
comment: pass
addrtype (LOCAL): pass
addrtype (MULTICAST): pass
addrtype (BROADCAST): pass
icmp (destination-unreachable): pass
icmp (source-quench): pass
icmp (time-exceeded): pass
icmp (parameter-problem): pass
icmp (echo-request): pass
== IPv6 ==
Creating 'ufw-check-requirements6'... done
Inserting RETURN at top of 'ufw-check-requirements6'... done
TCP: pass
UDP: pass
destination port: pass
source port: pass
ACCEPT: pass
DROP: pass
REJECT: pass
LOG: pass
hashlimit: FAIL
error was: ip6tables: No chain/target/match by that name.
limit: pass
state (NEW): FAIL
error was: ip6tables: No chain/target/match by that name.
state (RELATED): FAIL
error was: ip6tables: No chain/target/match by that name.
state (ESTABLISHED): FAIL
error was: ip6tables: No chain/target/match by that name.
state (INVALID): FAIL
error was: ip6tables: No chain/target/match by that name.
state (new, recent set): FAIL (no runtime support)
error was: ip6tables: No chain/target/match by that name.
state (new, recent update): FAIL (no runtime support)
error was: ip6tables: No chain/target/match by that name.
state (new, limit): FAIL
error was: ip6tables: No chain/target/match by that name.
interface (input): pass
interface (output): pass
multiport: pass
comment: pass
icmpv6 (destination-unreachable): pass
icmpv6 (packet-too-big): pass
icmpv6 (time-exceeded): pass
icmpv6 (parameter-problem): pass
icmpv6 (echo-request): pass
icmpv6 with hl (neighbor-solicitation): pass
icmpv6 with hl (neighbor-advertisement): pass
icmpv6 with hl (router-solicitation): pass
icmpv6 with hl (router-advertisement): pass
FAIL: check your kernel and that you have iptables >= 1.4.0
FAIL: check your kernel and iptables for additional runtime support
|
Hay problemas entre iptables y el kernel??
NOTA: hashlimit, limit y state están cargados en el kernel. |
|
Back to top |
|
|
esteban_conde Veteran
Joined: 04 Jun 2003 Posts: 1670
|
Posted: Sat Dec 06, 2014 12:57 pm Post subject: |
|
|
como lo hago: | localhost etc # systemctl start iptables
Failed to start iptables.service: Unit iptables.service failed to load: Invalid argument. See system logs and 'systemctl status iptables.service' for details.
localhost etc # iptables -t nat -A POSTROUTING -s 192.168.0.1 -o wlp2s16 -j MASQUERADE
localhost etc #
|
Vaya por delante que soy un usuario casero de iptables, no obstante creo que la forma de uso para iniciarlo no cambiará mucho respecto a un servidor en producción.
Analizamos el código de arriba:
systemctl start iptables me arroja un error parcido al tuyo sin embargo fijate que el comando iptables -t nat .... que le sigue me funciona, sirve para conectar una red con ip 192.168.0.1 al ordenador usado y darle salida a internet via la inalambrica en mi caso, deduzco (espero no estar equivocado) que iptables necesita una o varias ordenes simples --> el ejemplo de arriba sirve o compuestas --> un archivo de configuración seguido de iptables-save y con eso creo que iptables ya funcionaría echale un vistazo a man iptables para limpiar y reiniciar tablas y demás pero creo que para iniciar necesita un motivo. _________________ Saludos a tod@s, Esteban. |
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Sun Dec 07, 2014 8:58 pm Post subject: |
|
|
Hola esteban_conde:
Siguiendo tu consejo probé de cargas reglas que me bloquearan todo y funcionó, así que el problema no está en iptables sino en la comunicación entre ufw: todas las reglas que cargo desde ufw no llegan a iptables y por eso no funciona.
El problema está en que soy un completo ignorante en el tema de redes (y en este momento sin tiempo para estudiar) para trabajar netamente con iptables. Y como el firewall es para una compu de escritorio me incliné a algo "uncomplicated", pero no logro hacerlo andar.
Estoy empezando a mirar a shorewall..... |
|
Back to top |
|
|
opotonil l33t
Joined: 17 Jun 2005 Posts: 801 Location: 127.0.0.1
|
Posted: Tue Dec 09, 2014 8:38 am Post subject: |
|
|
Pregunta tonta, tienes habilitadas en el kernel las funcionalidades iptables de las que se queja:
Code: |
hashlimit: FAIL
error was: iptables: No chain/target/match by that name.
limit: pass
state (NEW): FAIL
error was: iptables: No chain/target/match by that name.
state (RELATED): FAIL
error was: iptables: No chain/target/match by that name.
state (ESTABLISHED): FAIL
error was: iptables: No chain/target/match by that name.
state (INVALID): FAIL
error was: iptables: No chain/target/match by that name.
state (new, recent set): FAIL (no runtime support)
error was: iptables: No chain/target/match by that name.
state (new, recent update): FAIL (no runtime support)
error was: iptables: No chain/target/match by that name.
state (new, limit): FAIL
error was: iptables: No chain/target/match by that name.
|
Salu2. _________________ Localnet
Films Localnet |
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Wed Dec 10, 2014 4:54 pm Post subject: |
|
|
Esa es otra rareza, los FAIL están en le kernel... |
|
Back to top |
|
|
esteban_conde Veteran
Joined: 04 Jun 2003 Posts: 1670
|
Posted: Thu Dec 11, 2014 9:42 am Post subject: |
|
|
Danos la salida de iptables -L _________________ Saludos a tod@s, Esteban. |
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Thu Dec 11, 2014 10:31 pm Post subject: |
|
|
Acá va...
Code: | # iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ufw-before-logging-forward all -- anywhere anywhere
ufw-before-forward all -- anywhere anywhere
ufw-after-forward all -- anywhere anywhere
ufw-after-logging-forward all -- anywhere anywhere
ufw-reject-forward all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-output all -- anywhere anywhere
ufw-before-output all -- anywhere anywhere
ufw-after-output all -- anywhere anywhere
ufw-after-logging-output all -- anywhere anywhere
ufw-reject-output all -- anywhere anywhere
ufw-track-output all -- anywhere anywhere
Chain ufw-after-forward (1 references)
target prot opt source destination
Chain ufw-after-input (1 references)
target prot opt source destination
Chain ufw-after-logging-forward (1 references)
target prot opt source destination
Chain ufw-after-logging-input (1 references)
target prot opt source destination
Chain ufw-after-logging-output (1 references)
target prot opt source destination
Chain ufw-after-output (1 references)
target prot opt source destination
Chain ufw-before-forward (1 references)
target prot opt source destination
Chain ufw-before-input (1 references)
target prot opt source destination
Chain ufw-before-logging-forward (1 references)
target prot opt source destination
Chain ufw-before-logging-input (1 references)
target prot opt source destination
Chain ufw-before-logging-output (1 references)
target prot opt source destination
Chain ufw-before-output (1 references)
target prot opt source destination
Chain ufw-reject-forward (1 references)
target prot opt source destination
Chain ufw-reject-input (1 references)
target prot opt source destination
Chain ufw-reject-output (1 references)
target prot opt source destination
Chain ufw-track-input (1 references)
target prot opt source destination
Chain ufw-track-output (1 references)
target prot opt source destination |
|
|
Back to top |
|
|
esteban_conde Veteran
Joined: 04 Jun 2003 Posts: 1670
|
Posted: Fri Dec 12, 2014 12:34 pm Post subject: |
|
|
Ha visto esto: http://linuxreviews.org/features/ipv6/iptables/
Lo digo por que en el primer mensaje que pones, hace muchas referencias a ipv6 e ip6tables.
No me veo muy capacitado para analizar la salida del comando iptables -L _________________ Saludos a tod@s, Esteban. |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Mon Dec 15, 2014 12:30 am Post subject: |
|
|
¿Que dice Code: | (root)# ufw status verbose | ? |
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Mon Dec 15, 2014 3:00 am Post subject: |
|
|
Hola esteban_conde!! Gracias por el link!! lamentablemente me falta mucho background para entender bien la información que da. Aún así no creo que el problema sea ipv6. A continuación te paso la salida de UFW con ipv6 desactivado.
Code: | # ufw enable
ERROR: problem running ufw-init
iptables-restore: line 4 failed
iptables-restore: line 68 failed
iptables-restore: line 51 failed
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/user/user.rules'
|
Quiosaq, te paso la salida pedida:
Code: | # ufw status verbose
Estado: activo
Acceso: on (medium)
Por defecto: deny (Entrada), allow (Salida)
Perfiles nuevos: skip
Hasta Acción Desde
----- ------ -----
80 ALLOW IN Anywhere
443 ALLOW IN Anywhere
22 ALLOW IN Anywhere
21 ALLOW IN Anywhere
17500 ALLOW IN Anywhere
|
Y repito
Code: | # iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ufw-before-logging-forward all -- anywhere anywhere
ufw-before-forward all -- anywhere anywhere
ufw-after-forward all -- anywhere anywhere
ufw-after-logging-forward all -- anywhere anywhere
ufw-reject-forward all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-output all -- anywhere anywhere
ufw-before-output all -- anywhere anywhere
ufw-after-output all -- anywhere anywhere
ufw-after-logging-output all -- anywhere anywhere
ufw-reject-output all -- anywhere anywhere
ufw-track-output all -- anywhere anywhere
Chain ufw-after-forward (1 references)
target prot opt source destination
Chain ufw-after-input (1 references)
target prot opt source destination
Chain ufw-after-logging-forward (1 references)
target prot opt source destination
Chain ufw-after-logging-input (1 references)
target prot opt source destination
Chain ufw-after-logging-output (1 references)
target prot opt source destination
Chain ufw-after-output (1 references)
target prot opt source destination
Chain ufw-before-forward (1 references)
target prot opt source destination
Chain ufw-before-input (1 references)
target prot opt source destination
Chain ufw-before-logging-forward (1 references)
target prot opt source destination
Chain ufw-before-logging-input (1 references)
target prot opt source destination
Chain ufw-before-logging-output (1 references)
target prot opt source destination
Chain ufw-before-output (1 references)
target prot opt source destination
Chain ufw-reject-forward (1 references)
target prot opt source destination
Chain ufw-reject-input (1 references)
target prot opt source destination
Chain ufw-reject-output (1 references)
target prot opt source destination
Chain ufw-track-input (1 references)
target prot opt source destination
Chain ufw-track-output (1 references)
target prot opt source destination |
Aca es donde aparece otra vez lo raro (raro para mí). La salida anterior es después de un "ufw enable", pero por lo general tengo desactivado porque no puedo entra ni a la web de este foro, "está todo bloqueado o deny". Como si UFW no lograra cargar las reglar a iptables.
No soy entendido en el tema, así cualquier ayuda con algo de explicación me resultaría extremadamente útil!!! |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Mon Dec 15, 2014 3:28 pm Post subject: |
|
|
Quote: | Code: | # ufw enable
ERROR: problem running ufw-init
iptables-restore: line 4 failed
iptables-restore: line 68 failed
iptables-restore: line 51 failed
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/user/user.rules' |
| Tendremos que ver que contienen estos archivos .rules. |
|
Back to top |
|
|
esteban_conde Veteran
Joined: 04 Jun 2003 Posts: 1670
|
Posted: Mon Dec 15, 2014 6:11 pm Post subject: |
|
|
Ya te he comentado que no estoy demasiado puesto pero me da que en las tres tablas (chains) que pones INPUT, FORWARD y OUTPUT estableces reject --anywre aniwre.
que teniendo en cuenta que la última regla es la que prevalece te deja bloqueado.
este es uno de ellos: | ufw-reject-output all -- anywhere anywhere |
fijate que está por detras en los tres casos de la regla que autorizaria el encaminamiento de (en español ENTRADA, ADELANTE Y SALIDA).
ahí va una forma de reiniciar iptables, sacado de man iptables: | -F, --flush [chain]
Flush the selected chain (all the chains in the table if none is
given). This is equivalent to deleting all the rules one by
one. |
En cristiano que borra todas las reglas que hayas definido antes si no funcionan.
Despues de dar ese comando (iptables -F) supongo que deberias ejecutar iptables-save o algo así. _________________ Saludos a tod@s, Esteban. |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Mon Dec 15, 2014 8:12 pm Post subject: |
|
|
Revisando la salida de Code: | # sh /usr/share/ufw/check-requirements | creo que te faltan algunas configuraciones en el kernel. Comprueba que tengas estos símbolos puestos:
Code: | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT "hashlimit" match support
CONFIG_NETFILTER_XT_MATCH_STATE "state" match support
CONFIG_NF_CONNTRACK Netfilter connection tracking support
CONFIG_NF_CONNTRACK_IPV6 Pv6 connection tracking support
|
Code: | grep -e CONFIG_NETFILTER_XT_MATCH_HASHLIMIT -e CONFIG_NETFILTER_XT_MATCH_STATE -e CONFIG_NF_CONNTRACK[^_] -e CONFIG_NF_CONNTRACK_IPV6 /usr/src/linux/.config |
|
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Mon Dec 22, 2014 8:03 pm Post subject: |
|
|
Hola gente!! Perdón por demorar mi respuesta, estuve desconectado.
Nuevamente muchas gracias a todo el foro por su ayuda, estoy aprendiendo muchísimo
Voy a hacer un repaso de los pasos que hago por si me faltó algo:
Ahora tengo que ejecutar “ufw disable” para poder usar internet, si no hago esto ni siquiera puedo sincronizar portage.
Para probar el firewall arranco así:
Code: | # ufw enable
ERROR: problem running ufw-init
iptables-restore: line 4 failed
iptables-restore: line 68 failed
iptables-restore: line 31 failed
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/user/user.rules' |
Si corro la sentencia por segunda vez aparece esto:
Code: | # ufw enable
ERROR: No se han podido cargar las reglas de registro |
También suelo correr esto:
Code: | # ufw default deny
La política incoming predeterminada cambió a «deny»
(asegúrese de actualizar sus reglas consecuentemente) |
El “asegúrese de actualizar sus reglas consecuentemente” no sé a que se refiere.
Uno de los tantos intentos que hice fue desinstalar y reinstalar todo. Cuando termino de instalar iptables (cargando los demonios y reiniciando la PC) corro esto:
Code: | iptables -F
ip6tables -F
iptables-save
ip6tables-save |
Luego regreso con UFW y corro lo siguiente:
Code: | ufw allow in http
ufw allow in https
ufw allow ssh
ufw allow ftp
ufw allow in 17500 |
Corro nuevamente las líneas de “iptables” que mencioné antes, vuelvo a correr “ufw enable” con el mismo error, pero a la segunda salta esto
Code: | # ufw enable
ERROR: initcaps
[Errno 2] iptables: Chain already exists. |
Luego de esto me queda todo el internet bloquedo y me veo obligado a correr “ufw disable”.
Quilosaq: acá van las salidas que me pediste:
Code: | # grep -e CONFIG_NETFILTER_XT_MATCH_HASHLIMIT -e CONFIG_NETFILTER_XT_MATCH_STATE -e CONFIG_NF_CONNTRACK[^_] -e CONFIG_NF_CONNTRACK_IPV6 /usr/src/linux/.config
CONFIG_NF_CONNTRACK=y
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NF_CONNTRACK_IPV6=y
|
/etc/ufw/before.rules
http://pastebin.com/SxMg6Gwn
/etc/ufw/user/user.rules
http://pastebin.com/K7Ddy9FM
Son muy noob en este tema así que el error puede estar donde sea!!!!!!
Alguna idea? |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Tue Dec 23, 2014 12:09 am Post subject: |
|
|
Habría que comprobar que ese archivo .config corresponde al kernel que tienes en ejecución. Mira si esto devuelve el mismo resultado:
Code: | (root)# modprobe configs && gunzip -c /proc/config.gz | grep -e CONFIG_NETFILTER_XT_MATCH_HASHLIMIT -e CONFIG_NETFILTER_XT_MATCH_STATE -e CONFIG_NF_CONNTRACK[^_] -e CONFIG_NF_CONNTRACK_IPV6 |
Si no devuelve nada o da error, posiblemete el kernel no está configurado para ofrecer su configuración a través de /proc/config.gz. Entonces habría que comprobar otros datos en el archivo .config.
Code: | ls -l /usr/src/linux/.config
grep Linux /usr/src/linux/.config |
y del kernel en ejecución:
|
|
Back to top |
|
|
natrix Guru
Joined: 23 Aug 2013 Posts: 556
|
Posted: Tue Dec 23, 2014 2:22 am Post subject: |
|
|
Ahí vamos:
Code: | # modprobe configs && gunzip -c /proc/config.gz | grep -e CONFIG_NETFILTER_XT_MATCH_HASHLIMIT -e CONFIG_NETFILTER_XT_MATCH_STATE -e CONFIG_NF_CONNTRACK[^_] -e CONFIG_NF_CONNTRACK_IPV6
CONFIG_NF_CONNTRACK=y
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NF_CONNTRACK_IPV6=y
# ls -l /usr/src/linux/.config
-rw-r--r-- 1 root root 86845 dic 21 22:46 /usr/src/linux/.config
# grep Linux /usr/src/linux/.config
# Linux/x86 3.17.7-gentoo Kernel Configuration
# Gentoo Linux
# uname -a
Linux natrix 3.17.7-gentoo #1 SMP Sun Dec 21 23:02:18 ART 2014 x86_64 Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz GenuineIntel GNU/Linux
|
Se ve algo raro? |
|
Back to top |
|
|
esteban_conde Veteran
Joined: 04 Jun 2003 Posts: 1670
|
Posted: Tue Dec 23, 2014 10:09 am Post subject: |
|
|
Quote: | Ahora tengo que ejecutar “ufw disable” para poder usar internet, si no hago esto ni siquiera puedo sincronizar portage.
| agarremos esto por los pelos, ¿quieres decir que si dejas las reglas como están no te deja salir a internet?, si es así la primera que veo es: Quote: | # ufw default deny | es decir que por defecto cierra todo entrada, salida y encaminamiento, esto es correcto, despues puedes ir abriendo caminos, pero claro tienes que abrirlos explicitamente su contraria es ufw default allow (creo que lo escribo bien) y efectivamente esto dejaria tu ordenador abierto a todo y posiblemente eso tampoco te interese.
A partir de ahí dependiendo de tus necesidades especificas y de la opción primera que hayas elegido podrás ir abriendo si has elgido deny o cerrando si has elegido allow.
Las posiblilidades son muchisimas me da la impresion de que tienes contradicciones en las reglas que has definido y eso hace que de errores al iniciar.
Una cosa que puedes hacer es probar iptables -F + iptables-save para ver si también te rompe el bloqueo y a partir de ahí ir definiendo reglas, por otro lado como no tengo instalado ufw a lo mejor digo una tontería pero lo veo casi más complicado que iptables a secas. _________________ Saludos a tod@s, Esteban. |
|
Back to top |
|
|
|