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
FIREQOS_CONNMARK_RESTORE="act_connmark" | |
# Download | |
interface veth2 lan output balanced rate 30Mbit | |
# 1SMR | |
class group 1SMR rate 20% ceil 80% | |
match dstmac 00:04:23:88:be:ee # MAC WAN del servidor de 1SMR | |
class youtube prio 7 |
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
# PARTE 2: Reglas IPTABLES | |
IPT=/sbin/iptables | |
EBT=/sbin/ebtables | |
# Activamos el forwarding | |
sysctl net.ipv4.ip_forward=1 | |
# Limpiamos todas las reglas | |
$IPT -t nat -F |
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
source ./config.cfg | |
###################################################### | |
# | |
# 1. Creamos los puentes y añadimos los interfaces | |
ip link add name br0 type bridge | |
for interface in "${LAN[@]}" | |
do | |
ip link set $interface up | |
ip link set $interface master br0 |
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
# Configuración | |
LAN=(enp13s0f0 enp13s0f1 enp14s0f0) | |
WAN=enp3s0 | |
DNS=(172.27.111.5 172.27.111.6) | |
IP=172.28.128.6 | |
MASK=23 | |
GATEWAY=172.28.128.1 |
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
acl localnet src 172.28.128.0/23 | |
acl SSL_ports port 443 | |
acl Safe_ports port 80 # http | |
acl Safe_ports port 21 # ftp | |
acl Safe_ports port 443 # https | |
acl Safe_ports port 70 # gopher | |
acl Safe_ports port 210 # wais | |
acl Safe_ports port 1025-65535 # unregistered ports | |
acl Safe_ports port 280 # http-mgmt | |
acl Safe_ports port 488 # gss-http |
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
include "/etc/bind/named.conf.options"; | |
include "/etc/bind/named.conf.logging"; | |
include "/etc/bind/named.conf.local"; | |
include "/etc/bind/named.conf.default-zones"; |
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
logging { | |
channel default_log { | |
file "/var/log/bind/default" versions 3 size 20m; | |
print-time yes; | |
print-category yes; | |
print-severity yes; | |
severity info; | |
}; | |
channel auth_servers_log { | |
file "/var/log/bind/auth_servers" versions 100 size 20m; |
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
options { | |
directory "/var/cache/bind"; | |
zone-statistics yes; | |
statistics-file "/var/log/bind/named.stats"; | |
// TODO: Actualizar bind para que esté soportado! | |
//statistics-channels { | |
// inet 127.0.0.1 port 8888 allow { 127.0.0.1; }; | |
// inet ::1 port 8888 allow { ::1; }; |
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 | |
# | |
# 'reset_courses' is a script to bulk reset all courses and unenrol their students. | |
# by Ruben Cancho (@canx) | |
# | |
# DEPENDENCIES: moosh installed. | |
# NOTE: for deleting old students is recommended to install "Inactive User Cleanup" plugin | |
# | |
############ CONFIG ############# | |
userdb='root' # add your moodle db user |
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 | |
exec 3>&1; | |
ips=$(dialog --title "IPs internas permitidas" --inputbox "Indica las IPs que podrán navegar sin restricciones (192.168.0.X)" 0 0 2>&1 1>&3); | |
exec 3>&1; | |
for ip in $ips; do | |
echo "iptables -I FORWARD -s 192.168.0.$ip -j ACCEPT"; | |
done |