More info as requested.
--- systemctl cat iptables.service ---
# /usr/lib/systemd/system/iptables.service
[Unit]
Description=IPv4 firewall with iptables
Before=ip6tables.service
After=syslog.target
AssertPathExists=/etc/sysconfig/iptables
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/iptables/iptables.init start
ExecReload=/usr/libexec/iptables/iptables.init reload
ExecStop=/usr/libexec/iptables/iptables.init stop
Environment=BOOTUP=serial
Environment=CONSOLETYPE=serial
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=basic.target
--- iptables -L -n ---
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:MY_PORT flags:0x17/0x02
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
--- journalctl -u iptables.service ---
-- Logs begin at Wed 2018-10-17 17:12:30 EDT, end at Wed 2018-10-17 17:20:01 EDT. --
Oct 17 17:12:33 localhost.localdomain systemd[1]: Starting IPv4 firewall with iptables...
Oct 17 17:12:33 localhost.localdomain iptables.init[700]: /usr/libexec/iptables/iptables.init: line 22: /etc/init.d/functions: No such file or directory
Oct 17 17:12:33 localhost.localdomain iptables.init[700]: iptables: Applying firewall rules: /usr/libexec/iptables/iptables.init: line 240: success: command not found
Oct 17 17:12:33 localhost.localdomain systemd[1]: Started IPv4 firewall with iptables.
--- netstat -tulpena | grep MY_PORT ---
tcp6 0 0 SERVER_IP:MY_PORT :::* LISTEN 1001 28252 1621/java
--- semanage port -l | grep MY_PORT ---
Command returns nothing
Is my rule wrong? Scanning with nmap does not show my port.
Starting Nmap 6.40 (
http://nmap.org ) at 2018-10-17 17:39 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000015s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 996 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
631/tcp open ipp
Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds