Skip to content

Instantly share code, notes, and snippets.

View LuisPalacios's full-sized avatar
🏠
Working from home

Luis Palacios Derqui LuisPalacios

🏠
Working from home
View GitHub Profile
@LuisPalacios
LuisPalacios / 50-usb-realtek-net.rules
Created March 7, 2023 22:16
Cambiar la configuración de los adaptadores ethernet Realtek USB
# This is used to change the default configuration of Realtek USB ethernet adapters
ACTION!="add", GOTO="usb_realtek_net_end"
SUBSYSTEM!="usb", GOTO="usb_realtek_net_end"
ENV{DEVTYPE}!="usb_device", GOTO="usb_realtek_net_end"
# Modify this to change the default value
ENV{REALTEK_MODE1}="1"
ENV{REALTEK_MODE2}="3"
@LuisPalacios
LuisPalacios / watch_eth_bridge_con_norte.service
Created March 7, 2023 20:44
Sur: Vigila el túnel bridge ethernet con norte
# Documentado en:
# https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
#
[Unit]
Description=Vigilante Bridge Ethernet con Norte
Wants=network-online.target internet_wait.service
After=network-online.target internet_wait.service
[Service]
Type=simple
@LuisPalacios
LuisPalacios / watch_eth_bridge_con_norte.timer
Created March 7, 2023 20:42
Sur: Vigila el túnel bridge ethernet con norte
# Documentado en:
# https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
#
[Unit]
Description=Vigila y activa el tunel ethernet bridge con Norte
[Timer]
# Cuanto espero tras el boot para ejecutar por primera vez
OnBootSec=1min
# Tiempo entre ejecuciones
@LuisPalacios
LuisPalacios / watch_eth_bridge_con_sur
Last active March 12, 2023 10:52
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. sur.midominio.com)
# -r <name> Nombre DNS Público del host remoto (i.e. norte.midominio.com)
# -b <interface> Nombre del interfaz utilizado para montar el BRIDGE
@LuisPalacios
LuisPalacios / watch_eth_bridge_con_sur.service
Created March 7, 2023 20:29
Norte: Vigila el túnel bridge ethernet con sur
[Unit]
Description=Vigilante Bridge Ethernet con Sur
Wants=network-online.target internet_wait.service
After=network-online.target internet_wait.service
[Service]
Type=simple
ExecStart=/usr/bin/watch_eth_bridge.sh $WATCH_ETH_BRIDGE_OPTS
EnvironmentFile=-/etc/default/watch_eth_bridge_con_sur
@LuisPalacios
LuisPalacios / watch_eth_bridge_con_sur.timer
Created March 7, 2023 20:26
Norte: Vigila el túnel bridge ethernet con sur
[Unit]
Description=Vigila y activa el tunel ethernet bridge con Sur
[Timer]
# Cuanto espero tras el boot para ejecutar por primera vez
OnBootSec=1min
# Tiempo entre ejecuciones
OnUnitActiveSec=1min
# Nombre del servicio a ejecutar
Unit=watch_eth_bridge_con_sur.service
@LuisPalacios
LuisPalacios / norte_firewall_2_post_network.sh
Created March 7, 2023 18:19
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
##
##
@LuisPalacios
LuisPalacios / sur_firewall_2_post_network.sh
Created March 7, 2023 17:22
Sur: 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
##
## Este fichero está relacionado con este apunte:
## https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
##
@LuisPalacios
LuisPalacios / norte_verifica_conectividad.sh
Last active March 8, 2023 16:01
Norte: Comprobar conectividad
#!/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
@LuisPalacios
LuisPalacios / norte_firewall_1_pre_network.sh
Last active October 13, 2024 11:18
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
##
##