Aquesta és una revisió antiga del document


Uncomplicated Firewall

manera alternativa de montar reglas de acceso con una sintáxis más sencilla, monta tablas y cadenas a su antojo

ufw [--dry-run] [options] [rule syntax]
  • options:
    • allow
    • deny
    • reject
    • limit: bloquea el acceso después de 6 intentos de conexión en 30 segundos (sospechas)
    • status: displays if the firewall is active or inactive
    • show: displays the current running rules on your firewall
    • reset: disables and resets the firewall to default
    • reload: reloads the current running firewall
    • disable: disables the firewall
  • gestionar servicio/protocolo:
    sudo ufw allow 22
    sudo ufw deny 22
    sudo ufw deny 22/tcp
    sudo ufw allow ssh # /etc/services
  • bloquear una ip+puerto a una ip específica:
    sudo ufw deny from 192.168.2.100/8 to 192.168.2.101 port 25
  • bloquear tráfico entrante, permitir saliente a un puerto:
    sudo ufw allow out on eth0 to any port 25 proto tcp
    sudo ufw deny in on eth0 from any 25 proto tcp
  • eliminar una regla:
    sudo ufw status numbered
    sudo ufw delete NUM # según lista
  • insertar una regla en una posición concreta:
    sudo ufw insert 1 allow from 10.213.6.0/24 port ssh

/via: https://www.linux.com/learn/introduction-uncomplicated-firewall-ufw

  • /etc/default/ufw: high level configuration, such as default policies, IPv6 support and kernel modules to use
  • /etc/ufw/before[6].rules: rules in these files are evaluated before any rules added via the ufw command
  • /etc/ufw/after[6].rules: rules in these files are evaluated after any rules added via the ufw command
  • /etc/ufw/sysctl.conf: kernel network tunables
  • /var/lib/ufw/user[6].rules or /lib/ufw/user[6].rules (0.28 and later): rules added via the ufw command (should not normally be edited by hand)
  • /etc/ufw/ufw.conf: sets whether or not ufw is enabled on boot, and in 9.04 (ufw 0.27) and later, sets the LOGLEVEL
  • /etc/ufw/after.init: initialization customization script run after ufw is initialized (ufw 0.34 and later)
  • /etc/ufw/before.init: initialization customization script run before ufw is initialized (ufw 0.34 and later)
  • permitir acceso a un puerto desde un rango IP:
    # ufw allow from 192.168.1.0/24 to 192.168.1.50 port ssh
  • linux/ufw/start.1563437693.txt.gz
  • Darrera modificació: 18/07/2019 01:14
  • per mate