2017-02-23 17:53:37 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
#move to script directory so all relative paths work
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
2017-04-23 09:07:22 +02:00
|
|
|
#includes
|
|
|
|
|
. ./config.sh
|
2017-02-23 17:53:37 +01:00
|
|
|
. ./colors.sh
|
|
|
|
|
|
2017-04-23 09:07:22 +02:00
|
|
|
#send a message
|
2017-02-23 17:53:37 +01:00
|
|
|
verbose "Configuring FirewallD"
|
|
|
|
|
#ssh should be on by default
|
|
|
|
|
|
2017-04-23 09:07:22 +02:00
|
|
|
#configure the firewall
|
2017-02-23 17:53:37 +01:00
|
|
|
firewall-cmd --permanent --zone=public --add-service={http,https}
|
|
|
|
|
firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/udp
|
|
|
|
|
firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/tcp
|
|
|
|
|
firewall-cmd --permanent --zone=public --add-port=16384-32768/udp
|
|
|
|
|
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p udp --dport 5060:5061 -m string --string "friendly-scanner" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p udp --dport 5060:5061 -m string --string "sipcli/" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p udp --dport 5060:5061 -m string --string "VaxSIPUserAgent/" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 5060:5061 -m string --string "friendly-scanner" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 5060:5061 -m string --string "sipcli/" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 5060:5061 -m string --string "VaxSIPUserAgent/" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p udp --dport 5080:5081 -m string --string "friendly-scanner" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p udp --dport 5080:5081 -m string --string "sipcli/" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p udp --dport 5080:5081 -m string --string "VaxSIPUserAgent/" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 5080:5081 -m string --string "friendly-scanner" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 5080:5081 -m string --string "sipcli/" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 5080:5081 -m string --string "VaxSIPUserAgent/" --algo bm -j DROP
|
|
|
|
|
firewall-cmd --add-service openvpn
|
|
|
|
|
firewall-cmd --permanent --add-service openvpn
|
|
|
|
|
firewall-cmd --reload
|
|
|
|
|
|
2017-04-23 09:07:22 +02:00
|
|
|
#send a message
|
2017-02-23 17:53:37 +01:00
|
|
|
verbose "FirewallD configured"
|