onsa
1/20/2017 - 5:59 PM

Install and configure uncomplicated firewall

Install and configure uncomplicated firewall

# install ufw

  sudo apt-get install ufw
  
# check firewall status

  sudo ufw status

# set up default rules

  sudo ufw default [deny|allow] [incoming|outgoing]

# set up rules for services

  sudo ufw allow ssh
  
# allow incoming tcp and udp packet on port 53

    sudo ufw allow 53

# allow incoming tcp packets on port 53

    sudo ufw allow 53/tcp

# allow incoming udp packets on port 53

    sudo ufw allow 53/udp

# show existing rules

  sudo ufw show added

# delete rule

  sudo ufw delete [existing rule]

# turn firewall on

  sudo ufw enable