参考
# systemctl start firewalld
# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: cockpit dhcpv6-client http ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
# firewall-cmd --permanent --zone=public --add-service=http
Warning: ALREADY_ENABLED: http
success
# firewall-cmd --permanent --zone=public --add-service=https
success
# mkdir /root/iptables
# vi /root/iptables/jpip_setup.sh
# chmod 700 /root/iptables/jpip_setup.sh
# /root/iptables/jpip_setup.sh
cat: delegated-apnic-latest: No such file or directory
# firewall-cmd --permanent --new-zone=domestic
success
# firewall-cmd --permanent --new-ipset=domestic --type=hash:net
success
# firewall-cmd --permanent --ipset=domestic --add-entries-from-file=/root/iptables/jpip
success
# firewall-cmd --permanent --info-ipset=domestic
domestic
type: hash:net
options:
entries:
# firewall-cmd --permanent --zone=domestic --add-source=ipset:domestic
success
# firewall-cmd --permanent --zone=public --remove-service=http
success
# firewall-cmd --permanent --zone=public --remove-service=https
success
# firewall-cmd --permanent --zone=domestic --add-service=http
success
# firewall-cmd --permanent --zone=domestic --add-service=https
success
# firewall-cmd --reload
success
#