Skip to content

Instantly share code, notes, and snippets.

@LuisPalacios
Last active March 8, 2023 17:43
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/cfffe7546faf1abed9d5bc48575e5dcc to your computer and use it in GitHub Desktop.
Save LuisPalacios/cfffe7546faf1abed9d5bc48575e5dcc to your computer and use it in GitHub Desktop.
Sur: Nombres de interfaces para montar el firewall
#!/bin/bash
##
## /root/firewall/sur_firewall_inames.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
##
##
# Nombres de las interfaces
#
export ifWan="eth0"
export ifBridgeIPTV="br206"
export ifLanInternetViaNorte="eth1.107"
export ifLanInternetViaSur="eth1.10"
export ifTunelNorte="tun1"
# Mi propia IP en las diferentes interfaces
export ipWan=`ip addr show dev ${ifWan} | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2`
export ipBridgeIPTV=`ip addr show dev ${ifBridgeIPTV} | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2`
export ipLanInternetViaNorte=`ip addr show dev ${ifLanInternetViaNorte} | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2`
export ipLanInternetViaSur=`ip addr show dev ${ifLanInternetViaSur} | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2`
## REDES PRIVADAS desde las que acepto tráfico
# Prefijos separados por espacios
#
export INTRANET="192.168.206.0/24 192.168.107.0/24 192.168.10.0/24 192.168.224.0/24 192.168.222.0/24"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment