Skip to content

Instantly share code, notes, and snippets.

@LuisPalacios
Last active April 28, 2023 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LuisPalacios/bcc7df9cd60937f6cec40a6c9ede6469 to your computer and use it in GitHub Desktop.
Save LuisPalacios/bcc7df9cd60937f6cec40a6c9ede6469 to your computer and use it in GitHub Desktop.
Definir nombres, ip's, etc. para el networking.
#!/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