Last active
April 28, 2023 10:10
-
-
Save LuisPalacios/bcc7df9cd60937f6cec40a6c9ede6469 to your computer and use it in GitHub Desktop.
Definir nombres, ip's, etc. para el networking.
This file contains 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. | |
# | |
# Está relacionado con este apunte: | |
# https://www.luispa.com/administración/2023/04/08/networking-avanzado.html | |
# | |
## ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- | |
## | |
## Interfaces y direcciones | |
## | |
ifLAN="vlan100" | |
ipLAN=`ip addr show dev ${ifLAN} | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2 | head -1` | |
ifWAN="ppp0" | |
rIF_Internet=${ifWAN} # Router (interfaz) hacia internet | |
ifMovistarDatos="vlan6" | |
ifVLAN33="33" # VLAN especial para pruebas | |
## | |
## Rangos permitidos en el firewall | |
## | |
INTRANET="192.168.0.0/16" # Redes de casa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment