大作業13-防火牆設定firewall
阿新 • • 發佈:2018-12-21
# MySQL埠: [[email protected] ~]# sh ./cmd.sh "/root/DBServerIP.txt" "root" "lri35krJF;ba" "firewall-add-port=3306/tcp --permanent" # web埠: [[email protected] ~]# sh ./cmd.sh "/root/WebServerIP.txt" "root" "lri35krJF;ba" "firewall-cmd --zone=public --add-port=80/tcp --permanent; firewall-cmd --zone=public --add-port=8080/tcp --permanent" # NFS埠,客戶端和服務端都需要監聽: [
[email protected] ~]# sh ./cmd.sh "/root/ipAll.txt" "root" "lri35krJF;ba" "firewall-cmd --zone=public --add-port=111/tcp --permanent" # zabbix埠: [[email protected] ~]# sh ./cmd.sh "/root/ipAll.txt" "root" "lri35krJF;ba" "firewall-cmd --zone=public --add-port=10050/tcp --permanent" # 客戶端 [[email protected]~]# sh ./cmd.sh "/root/zabixIP.txt" "root" "lri35krJF;ba" "firewall-cmd --zone=public --add-port=10051/tcp --permanent" # 服務端 Mycat埠: [[email protected] ~]# sh ./cmd.sh "/root/MycatIP.txt" "root" "lri35krJF;ba" "firewall-cmd --zone=public --add-port=8066/tcp --permanent; firewall-cmd --zone=public --add-port=9066/tcp --permanent" # 重啟firewall服務: [[email protected] ~]# sh ./cmd.sh "/root/ipAll.txt" "root" "lri35krJF;ba" "systemctl stop firewalld.service; systemctl start firewalld.service"