<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="th">
	<id>https://wiki.thnic.or.th/index.php?action=history&amp;feed=atom&amp;title=2._%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B8%84%E0%B9%88%E0%B8%B2_firewall_CentOS_7</id>
	<title>2. ตั้งค่า firewall CentOS 7 - ประวัติรุ่นแก้ไข</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thnic.or.th/index.php?action=history&amp;feed=atom&amp;title=2._%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B8%84%E0%B9%88%E0%B8%B2_firewall_CentOS_7"/>
	<link rel="alternate" type="text/html" href="https://wiki.thnic.or.th/index.php?title=2._%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B8%84%E0%B9%88%E0%B8%B2_firewall_CentOS_7&amp;action=history"/>
	<updated>2026-10-23T07:41:15Z</updated>
	<subtitle>ประวัติรุ่นแก้ไขของหน้านี้ในวิกิ</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.thnic.or.th/index.php?title=2._%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B8%84%E0%B9%88%E0%B8%B2_firewall_CentOS_7&amp;diff=322&amp;oldid=prev</id>
		<title>Titipong: Created page with &quot;1. ตรวจสอบสถานะ firewalld service บน mail server โดยต้องได้สถานะ active (running)   &#039;&#039;&#039;# systemctl status firewalld&#039;&#039;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.thnic.or.th/index.php?title=2._%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B8%84%E0%B9%88%E0%B8%B2_firewall_CentOS_7&amp;diff=322&amp;oldid=prev"/>
		<updated>2020-10-26T16:19:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;1. ตรวจสอบสถานะ firewalld service บน mail server โดยต้องได้สถานะ active (running)   &amp;#039;&amp;#039;&amp;#039;# systemctl status firewalld&amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;หน้าใหม่&lt;/b&gt;&lt;/p&gt;&lt;div&gt;1. ตรวจสอบสถานะ firewalld service บน mail server โดยต้องได้สถานะ active (running)&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# systemctl status firewalld&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;ตัวอย่าง&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;Active: &amp;lt;span style=&amp;#039;color:red&amp;#039;&amp;gt;active (running)&amp;lt;/span&amp;gt; since Mon 2019-11-18 14:12:03 +07; 1h 13min ago&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
2. ตรวจสอบ firewall zone และ network interface ที่เปิดอยู่&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --get-active-zones&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;ตัวอย่าง&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 public&lt;br /&gt;
 interfaces: ens32&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
3. ตรวจสอบรายการ services ของ firewall ที่ zone public &lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --zone=public --list-services&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;ตัวอย่าง&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039; cockpit dhcpv6-client ssh &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
4. เปิด firewall services ที่ zone public ของ mail server (สามารถเปิดเท่าต้องการได้)&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --permanent --zone=public --add-service=http&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --permanent --zone=public --add-service=https&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --permanent --zone=public --add-service=mysql&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --permanent --zone=public --add-service=smtp&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --permanent --zone=public --add-service=smtps&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --permanent --zone=public --add-service=imap&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --permanent --zone=public --add-service=imaps&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --reload&lt;br /&gt;
&lt;br /&gt;
5. ตรวจสอบรายการ services ของ firewall ที่ zone public อีกครั้ง จะพบ services เปิดเพิ่มขึ้นมา&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;*ref: configure firewall services for mail server (https://spalinux.com/2015/06/centos-7-basic-configure-firewall-by-firewall-cmd)&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# firewall-cmd --zone=public --list-services&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;ตัวอย่าง&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039; cockpit dhcpv6-client http https imap imaps mysql smtp smtps ssh &amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
6. ปิด selinux (เพื่อสะดวกต่อการ configure แต่ความปลอดภัยจะลดลง)&lt;br /&gt;
*เปลี่ยน SELinux=enforcing เป็น SELinux=disabled&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# vi /etc/selinux/config&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 # This file controls the state of SELinux on the system.&lt;br /&gt;
 # SELINUX= can take one of these three values:&lt;br /&gt;
 #       enforcing - SELinux security policy is enforced.&lt;br /&gt;
 #       permissive - SELinux prints warnings instead of enforcing.&lt;br /&gt;
 #       disabled - No SELinux policy is loaded.&lt;br /&gt;
 SELINUX=&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;[[disabled]]&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 # SELINUXTYPE= can take one of these two values:&lt;br /&gt;
 #       targeted - Targeted processes are protected,&lt;br /&gt;
 #       mls - Multi Level Security protection.&lt;br /&gt;
 SELINUXTYPE=targeted&lt;br /&gt;
	&lt;br /&gt;
*Restart ระบบ และทำการตรวจสอบ&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# reboot&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*ตรวจสอบสถานะของ SELinux&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# sestatus&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 disabled&lt;br /&gt;
&lt;br /&gt;
7. ติดตั้ง wget เพื่อใช้ download service ที่จำเป็นต้องใช้งานเพิ่ม&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# yum install wget&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Titipong</name></author>
	</entry>
</feed>