This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fichero /etc/knockd.conf | |
| # | |
| # El Port Knocking (llamar a la puerta) consiste en enviar (t铆picamente) tres paquetes a tu servidor | |
| # (firewall) para que te abra un puerto concreto. Tenemos el puerto de SSH (22) cerrado (haciendo | |
| # drops). Mandamos desde internet tres paquetes (SYN) con una cadencia determinada; el router/firewall | |
| #聽se da por enterado (est谩n llamando a la puerta) y te abre durante un rato (a la IP desde donde est谩s | |
| #聽mandado esos paquetes) el puerto 22. Boom !!! ya puedes entrar !!! | |
| # | |
| # Este fichero es un ejemplo de configuraci贸n y est谩 relacionado con este apunte: | |
| # https://www.luispa.com/administraci贸n/2023/04/08/networking-avanzado.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # /root/firewall/firewall_verifica.sh | |
| # | |
| # Script que verifica que la configuracion de la red es correcta, | |
| # | |
| # Est谩 relacionado con este apunte: | |
| # https://www.luispa.com/administraci贸n/2023/04/08/networking-avanzado.html | |
| # | |
| ## ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # /root/firewall/firewall_2_post_network.sh | |
| # | |
| # Script que se ejecuta tras activar la red y termina de instalar las reglas de iptables | |
| # y realiza las 煤ltimas confirmaciones... | |
| # | |
| # Est谩 relacionado con este apunte: | |
| # https://www.luispa.com/administraci贸n/2023/04/08/networking-avanzado.html | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # /root/firewall/firewall_1_pre_network.sh | |
| # | |
| # Script que instala las reglas con iptables. Se debe ejecutar antes de tener la | |
| # red activa, para que nunca pueda activarse la red sin estar las reglas antes puestas. | |
| # | |
| # Est谩 relacionado con este apunte: | |
| # https://www.luispa.com/administraci贸n/2023/04/08/networking-avanzado.html | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # /etc/default/netSetupVars | |
| # Script utilizado durante la instalaci贸n de reglas iptables durante el arranque | |
| # del sistema y durante la construcci贸n de t煤neles con OpenVPN. Es un fichero que | |
| # define con variables los nombres de las interfaces, direcciones IP, etc. que son | |
| # utilizados durante la protecci贸n con iptables, creaci贸n de t煤neles, etc. | |
| # | |
| # Su funci贸n es: Definir nombres, ip's, etc. para el networking. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Script utilizado durante la instalaci贸n de reglas iptables durante el arranque | |
| # del sistema. Se ejecuta desde otros scripts y tiene dependencia con el fichero | |
| # de definici贸n de variables: | |
| # | |
| # /etc/default/netSetupVars | |
| # | |
| # Su funci贸n es: Quitar todas las reglas del firewall (iptables) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fichero systemd: | |
| # /etc/systemd/system/firewall_2_post_network.service | |
| # | |
| # Termina de activa reglas con iptables tras tener la red ya disponible. | |
| # | |
| # Para activarlo ejecutar: | |
| # systemctl enable firewall_2_post_network.service | |
| # | |
| # Es fichero est谩 relacionado con este apunte: | |
| # https://www.luispa.com/administraci贸n/2023/04/08/networking-avanzado.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fichero systemd: | |
| # /etc/systemd/system/firewall_1_pre_network.service | |
| # | |
| # Activa reglas con iptables llamando a un script. | |
| # | |
| # Para activarlo ejecutar: | |
| # systemctl enable firewall_1_pre_network.service | |
| # | |
| # Es fichero est谩 relacionado con este apunte: | |
| # https://www.luispa.com/administraci贸n/2023/04/08/networking-avanzado.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Este servicio comprueba si tengo acceso a internet y mientras que | |
| # no lo tenga se queda esperando (sleep's de 1 seg). Es bastante 煤til | |
| # cuando queremos que otros servicios esperen a tener internet. | |
| # | |
| # Crea el fichero /etc/systemd/system/internet_wait.service | |
| # Instalar con: | |
| # systemctl enable internet_wait.service | |
| # | |
| # En aquellos servicios que queremos que esperen a tener interent | |
| # tenemos que modificar su fichero .service y a帽adir al final de |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |