LoginSignup
1
3

More than 5 years have passed since last update.

firewalldでのポートの開け方と閉じ方

Last updated at Posted at 2017-03-03

例えばIMAP4

開ける

vim /etc/firewalld/services/imap4.xml                                
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>IMAP4</short>
  <description>The Internet Message Access Protocol version 4 (IMAP4) allows a local client to access email on
   a remote server in a secure way. If you plan to provide a IMAP4 service (e.g. with dovecot), enable this option.</description>
  <port protocol="tcp" port="143"/>
</service>
firewall-cmd --add-service=imap4 --zone=public --permanent
firewall-cmd --list-services --zone=public  --permanent
firewall-cmd --reload
iptables -L -n | grep 143

閉じる

rm /etc/firewalld/services/imap4.xml
firewall-cmd --remove-service=imap4 --zone=public --permanent
firewall-cmd --list-services --zone=public  --permanent
firewall-cmd --reload
iptables -L -n | grep 143
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3