Skip to content

Instantly share code, notes, and snippets.

@xergio
xergio / firewall_1_pre_network.service
Created June 3, 2025 20:10 — forked from LuisPalacios/firewall_1_pre_network.service
Norte: Servicio para la activación del firewall. Parte 1
# Este servicio activa reglas con iptables llamando a un script
#
# Instalar con:
# systemctl enable firewall_1_pre_network.service
#
[Unit]
Description=Activar reglas iptables antes que la red
Wants=network-pre.target
Before=network-pre.target
@xergio
xergio / firewall_2_post_network.service
Created June 3, 2025 20:10 — forked from LuisPalacios/firewall_2_post_network.service
Norte: Servicio para la activación del firewall. Parte 2
# Este servicio activa reglas con iptables llamando a un script
#
# Instalar con:
# systemctl enable firewall_2_post_network.service
#
[Unit]
Description=Activar reglas iptables despues de la red
Wants=network-online.target internet_wait.service
After=network-online.target internet_wait.service
@xergio
xergio / norte_firewall_clean.sh
Created June 3, 2025 20:10 — forked from LuisPalacios/norte_firewall_clean.sh
Norte: parte del firewall, limpia iptables
#!/bin/bash
#
## Servidor ‘norte’
##
## Este fichero está relacionado con este apunte:
## https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
##
#
# Quita las iptables por completo, lo permite todo.
#
@xergio
xergio / norte_firewall_inames.sh
Created June 3, 2025 20:10 — forked from LuisPalacios/norte_firewall_inames.sh
Norte: Script que define las interfaces para el firewall
#!/bin/bash
##
## /root/firewall/norte_firewall_inames.sh
##
## Script que configura iptables en un servidor Raspbian OS
##
## Este fichero está relacionado con este apunte:
## https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
##
@xergio
xergio / norte_firewall_1_pre_network.sh
Created June 3, 2025 20:10 — forked from LuisPalacios/norte_firewall_1_pre_network.sh
Norte: Script que configura iptables antes de que se active la red Raw
#!/bin/bash
##
## /root/firewall/norte_firewall_1_pre_network.sh
##
## Script que configura iptables en un servidor Raspbian OS
## que actúa como "norte" en este apunte:
## https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
##
##
@xergio
xergio / norte_firewall_2_post_network.sh
Created June 3, 2025 20:10 — forked from LuisPalacios/norte_firewall_2_post_network.sh
Norte: Script parte del firewall, que se ejecuta después de tener la red activa
#!/bin/bash
##
## /root/firewall/sur_firewall_2_post_network.sh
##
## Script que configura iptables en un servidor Raspbian OS
## actuando de "norte" en este apunte:
## https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
##
##
#!/bin/bash
#
# Script que verifica que la configuracion de la red es correcta,
# que hay conectividad con internet, prueba servicios, etc.
#
# Copyright (C) 2006 Luis Palacios
#
# Variables de trabajo
temporal=/tmp/temp-parchis-verifica.sh
@xergio
xergio / watch_eth_bridge_con_sur
Created June 3, 2025 20:11 — forked from LuisPalacios/watch_eth_bridge_con_sur
Norte: Fichero de configuración para watch_eth_bridge_con_xxxxx.service
# /etc/default/watch_eth_bridge_con_sur
# Fichero de configuración para watch_eth_bridge_xxxxx.service
#
# Un ejemplo de caso de uso está descrito en este apunte:
# https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
#
# Opciones watch_eth_bridge.sh
# -l <name> Nombre DNS Público del este host (i.e. norte.midominio.com)
# -r <name> Nombre DNS Público del host remoto (i.e. sur.midominio.com)
# -b <interface> Nombre del interfaz utilizado para montar el BRIDGE
@xergio
xergio / watch_eth_bridge.sh
Created June 3, 2025 20:11 — forked from LuisPalacios/watch_eth_bridge.sh
Comprueba conectividad del tunel ethernet bridge openvpn
#!/bin/bash
#
# /usr/bin/watch_eth_bridge.sh
#
# Un ejemplo de caso de uso está descrito en este apunte:
# https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
#
#
# Este script comprueba conectividad del tunel ethernet bridge openvpn entre
# dos servidores. Primero se asegura de tener las entradas correctas en el
@xergio
xergio / norte_access_server.conf
Created June 3, 2025 20:11 — forked from LuisPalacios/norte_access_server.conf
Norte: /etc/openvpn/server/norte_access_server.conf
## Este fichero está relacionado con este apunte:
## https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
#
# Configuración de "Access Server" de OpenVPN
#
# Server (Servidor de Acceso) exponiendo el siguiente
# rango dentro del tunel. Escucho en un puerto cualquiera libre.
server 192.168.224.0 255.255.255.0