国内の IP アドレス一覧をダウンロードする
wget -O domestic.txt https://ipv4.fetus.jp/jp.txtゾーンを定義する
domestic ゾーンの作成
firewall-cmd --permanent --new-zone=domesticipset を作成
domestic 用の ipset を作成
firewall-cmd --permanent --new-ipset=domestic --type=hash:netIPアドレスリストファイルを ipset に流し込む
firewall-cmd --permanent --ipset=domestic --add-entries-from-file=domestic.txt読み込まれた ipset を domestic ゾーンに適用
firewall-cmd --permanent --zone=domestic --add-source=ipset:domesticサービスを割り当てる
domestic ゾーンにサービスを追加
firewall-cmd --permanent --add-service=imaps --zone=domestic
firewall-cmd --permanent --add-service=smtps --zone=domestic設定反映
firewall-cmd --reload後片付け
rm domestic.txt参考にしたサイト



コメント