Forwarding a subred

¿Algo falla o no sabes como funciona? Pide ayuda aquí!
Avatar de Usuario
egrueda
Pi God
Pi God
Mensajes: 3426
Registrado: 10 Feb 2017, 19:31
Agradecido: 7 veces
Agradecimiento recibido: 269 veces

Sin ver el staus completo, se me ocurre que deberías permitir específicamente el forward.

Código: Seleccionar todo

ufw route allow in on eth0 out on usb0
Del manual de ufw:
Rules for traffic not destined for the host itself but instead for traffic that should be routed/forwarded through the firewall should specify the route keyword before the rule (routing rules differ signifi‐ cantly from PF syntax and instead take into account netfilter FORWARD chain conventions).
tormund1985
Pi Alpha
Pi Alpha
Mensajes: 18
Registrado: 02 Mar 2022, 13:03
Agradecido: 0
Agradecimiento recibido: 1 vez

egrueda escribió: 25 Mar 2022, 10:57 Sin ver el staus completo, se me ocurre que deberías permitir específicamente el forward.

Código: Seleccionar todo

ufw route allow in on eth0 out on usb0
Del manual de ufw:
Rules for traffic not destined for the host itself but instead for traffic that should be routed/forwarded through the firewall should specify the route keyword before the rule (routing rules differ signifi‐ cantly from PF syntax and instead take into account netfilter FORWARD chain conventions).
Muy buenas de nuevo,

Nada, las reglas están persistentes sin embargo continúa bloqueando el tráfico:

Código: Seleccionar todo

mar 30 08:21:25 sentinel kernel: [UFW BLOCK] IN=eth0 OUT=usb0 MAC=e4:5f:01:28:05:2c:6c:1c:71:27:27:ae:08:00 SRC=192.168.1.108 DST=8.8.8.8 LEN=81 TOS=0x00 PREC=0x00 TTL=63 ID=9446 DF PROTO=UDP SPT=38071 DPT=53 LEN=61 
mar 30 08:21:25 sentinel kernel: [UFW BLOCK] IN=eth0 OUT=usb0 MAC=e4:5f:01:28:05:2c:6c:1c:71:27:27:ae:08:00 SRC=192.168.1.108 DST=161.117.253.222 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=56872 DF PROTO=TCP SPT=48699 DPT=42045 WINDOW=14600 RES=0x00 SYN URGP=0 
Avatar de Usuario
egrueda
Pi God
Pi God
Mensajes: 3426
Registrado: 10 Feb 2017, 19:31
Agradecido: 7 veces
Agradecimiento recibido: 269 veces

tormund1985 escribió: 25 Mar 2022, 10:50También incluí en el rc.local la siguiente regla:
No mezcles ufw y comandos iptables por otro lado.
Si usas ufw para gestionar el firewall, no lo gestiones además por otro lado ni añadas reglas fuera de ufw
Te puedes volver loco para detectar el origen de un problema.

Elimina los comandos iptables "manuales" y reinicia para regarcar el firewall de ucw
Después envíanos un "ufw status verbose" a ver qué reglas tienes y en qué orden
tormund1985
Pi Alpha
Pi Alpha
Mensajes: 18
Registrado: 02 Mar 2022, 13:03
Agradecido: 0
Agradecimiento recibido: 1 vez

egrueda escribió: 30 Mar 2022, 08:38
tormund1985 escribió: 25 Mar 2022, 10:50También incluí en el rc.local la siguiente regla:
No mezcles ufw y comandos iptables por otro lado.
Si usas ufw para gestionar el firewall, no lo gestiones además por otro lado ni añadas reglas fuera de ufw
Te puedes volver loco para detectar el origen de un problema.

Elimina los comandos iptables "manuales" y reinicia para regarcar el firewall de ucw
Después envíanos un "ufw status verbose" a ver qué reglas tienes y en qué orden
Hecho:

Código: Seleccionar todo

Status: active
Logging: off
Default: deny (incoming), allow (outgoing), allow (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
Anywhere on eth0           ALLOW IN    Anywhere                  
Anywhere                   ALLOW IN    192.168.1.108             
Anywhere                   ALLOW IN    192.168.1.0/24            
53/udp                     ALLOW IN    Anywhere                  
53                         ALLOW IN    192.168.1.108             
Anywhere (v6) on eth0      ALLOW IN    Anywhere (v6)             
53/udp (v6)                ALLOW IN    Anywhere (v6)             

Anywhere                   ALLOW OUT   Anywhere on eth0          
Anywhere (v6)              ALLOW OUT   Anywhere (v6) on eth0     

Anywhere on usb0           ALLOW FWD   Anywhere on eth0          
Anywhere (v6) on usb0      ALLOW FWD   Anywhere (v6) on eth0  
Mil gracias por el interés en resolver el problema.
Última edición por tormund1985 el 30 Mar 2022, 12:50, editado 1 vez en total.
Avatar de Usuario
egrueda
Pi God
Pi God
Mensajes: 3426
Registrado: 10 Feb 2017, 19:31
Agradecido: 7 veces
Agradecimiento recibido: 269 veces

Creo que te faltan líneas de arriba, ¿has ejecutado un "ufw status verbose"?
tormund1985
Pi Alpha
Pi Alpha
Mensajes: 18
Registrado: 02 Mar 2022, 13:03
Agradecido: 0
Agradecimiento recibido: 1 vez

egrueda escribió: 30 Mar 2022, 12:45 Creo que te faltan líneas de arriba, ¿has ejecutado un "ufw status verbose"?
Editado, disculpa que se me escaparon del copy&paste
Responder