## 설치 ##
yum install firewalld firewall-config –y
## 설정 ##
vi /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name="ssh"/>
<service name="dhcpv6-client"/>
<port protocol="tcp" port="22"/>
<port protocol="tcp" port="8080"/>
<port protocol="tcp" port="5555"/>
<masquerade/>
<forward-port to-addr="10.0.1.2" to-port="1521" protocol="tcp" port="1521"/>
<rule family="ipv4">
<source address="10.0.0.2"/>
<service name="5555"/>
<accept/>
</rule>
</zone>
## oracle port forwading 예시 ##
[root@dev-was-vm ~]# cat /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name="ssh"/>
<service name="dhcpv6-client"/>
<port protocol="tcp" port="22"/>
<port protocol="tcp" port="1521"/>
<port protocol="tcp" port="80"/>
<port protocol="tcp" port="443"/>
<masquerade/>
<forward-port to-addr="10.0.1.2" to-port="1521" protocol="tcp" port="1521"/>
</zone>
[root@dev-was-vm ~]#
1. 방화벽 재기동
firewall-cmd –-reload
2. 수동 재기동
firewall-cmd --permanent --zone=public --add-port=9993/tcp
systemctl stop firewalld
systemctl mask firewalld
systemctl enable iptable
5. rule 저장
service iptables save
'Linux' 카테고리의 다른 글
GeoIP 설치 (0) | 2025.03.10 |
---|---|
local disk 추가 (0) | 2025.03.10 |
iptables 설정 (2/2) (0) | 2025.03.09 |
iptables 설정 (1/2) (0) | 2025.03.09 |
AWS 에서 NFS 설정 (0) | 2025.03.09 |