Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Criar o presente script no diretório /mnt/config com o nome firewall.sh e executa-lo com o comando "bash /mnt/config/firewall.sh
- LOCALNET=192.168.1.10/24
- SIPSERVER=192.168.1.0
- iptables -F
- iptables -X
- iptables -P INPUT DROP
- # SSH
- iptables -A INPUT -p tcp --dport 22 -s $LOCALNET -j ACCEPT
- # Rede Interna
- iptables -A INPUT -s $LOCALNET -j ACCEPT
- # SIP Server
- iptables -A INPUT -p udp -s $SIPSERVER -j ACCEPT
- # Libera ping
- iptables -A INPUT -p icmp -j ACCEPT
- iptables -P OUTPUT ACCEPT
- echo "Executar o comando 'iptables-save > /etc/iptables.conf'"
- echo "Logo após, executar o comando 'cp /etc/iptables.conf /mnt/config/'"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement