Skip to content

Instantly share code, notes, and snippets.

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/b54b27d34e9f3c718eb27fc3de977559 to your computer and use it in GitHub Desktop.
Save LuisPalacios/b54b27d34e9f3c718eb27fc3de977559 to your computer and use it in GitHub Desktop.
Sur: Script que se ejecuta al tirar el túnel de acceso.
#!/bin/bash
# Script que se ejecuta al tirar el tunel
#
# /etc/openvpn/client/sur_cliente_access_de_norte_DOWN.sh
#
# Documentado en:
# https://www.luispa.com/linux/2014/10/19/bridge-ethernet.html
#
# Interfaces, rutas + IP y MACs asociaré a las interfaces tap y bridge
. /etc/openvpn/client/sur_cliente_access_de_norte_CONFIG.sh
# Quito MASQUERADE para los clientes de LAN
iptables -t nat -D POSTROUTING -o ${ifNorteTunel} -j MASQUERADE
## Tabla de routing para la LAN
##
## Equipos que salen a internet vía el router de Movistar en NORTE
##
ip rule del from ${ipNorteLanRango} table Norte 2>/dev/null
ip route del default via ${ipNorteTunelRouter} table Norte 2>/dev/null
ip route del ${ipNorteLanRango} dev ${ifNorteLan} table Norte 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment