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/d90ff449e2e9886341ffa019008757b4 to your computer and use it in GitHub Desktop.
Save LuisPalacios/d90ff449e2e9886341ffa019008757b4 to your computer and use it in GitHub Desktop.
Activa reglas con iptables llamando a un script
# Fichero systemd:
# /etc/systemd/system/firewall_1_pre_network.service
#
# Activa reglas con iptables llamando a un script.
#
# Para activarlo ejecutar:
# systemctl enable firewall_1_pre_network.service
#
# Es fichero está relacionado con este apunte:
# https://www.luispa.com/administración/2023/04/08/networking-avanzado.html
#
[Unit]
Description=Activar reglas iptables antes que la red
Wants=network-pre.target
Before=network-pre.target
[Service]
Type=oneshot
ExecStart=/bin/bash /root/firewall/firewall_1_pre_network.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment