A list of commands to setup Firewall for Asterisk
sudo apt update
sudo apt install ufw -y
Allow port access on the firewall by running the following command:
sudo ufw allow 80
sudo ufw allow 22
sudo ufw allow 10000:20000/udp
sudo ufw allow 5060:5061/udp
check status
sudo ufw status verbose
Status: inactive
turn on
sudo ufw enable
set ports in config
sudo tee /etc/asterisk/rtp.conf<<EOF
[general]
rtpstart=10000
rtpend=20000
EOF
verify
nano /etc/asterisk/rtp.conf
you can view the status
sudo ufw status verbose