RHEL 7에서 iptables를 시작할 수 없습니다.

RHEL 7에서 iptables를 시작할 수 없습니다.

RHEL7에서 iptables를 사용하려고 합니다. 나는 다음을 수행했습니다.

systemctl mask firewalld
systemctl stop firewalld
yum install iptables-services
systemctl enable iptables
systemctl start iptables

하지만 마지막 줄에 오류가 있습니다.

Job for iptables.service failed because the control process exited with error code. See "systemctl status iptables.service" and "journalctl -xe" for details.

journalctl -u service-name.service
-- No entries --

그리고journalctl -xe

Jan 13 12:30:03 localhost.localdomain systemd[1]: Unit iptables.service entered failed state.
Jan 13 12:30:03 localhost.localdomain systemd[1]: iptables.service failed.
Jan 13 12:30:03 localhost.localdomain polkitd[10240]: Unregistered Authentication Agent for unix-process:27798:561438909 (system bus name :1.22082, object path /org/freedesktop/P
lines 1222-1263/1263 (END)

실패했다는 말만 할 뿐, 원인은 알 수 없고, 무엇인지는 모르겠습니다.unix-process용 등록되지 않은 인증 에이전트또는 관련된 경우를 의미합니다. 나는 그것이 항상 iptables 오류 행을 따르기 때문이라고 생각합니다. 하지만 이것이 무엇을 의미하는지, 구체적으로 어떻게 해결해야 하는지 모르겠습니다. 어느 것이 원인이고 어느 것이 결과인지도 마찬가지입니다.

추가적으로:

sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

그리고 iptables-restore멈춘다.

다른글은 도움이 안되네요.

해결됨:

실제 원인, 잠금 처리 등이 무엇인지 정확히 모르겠지만 몇 번 재부팅하고 실행한 후에 iptables-restore는 이제 서비스를 시작할 수 있습니다.

iptables 서비스를 시작하려면 어떻게 해야 합니까?

답변1

짧은 대답은 알고 있지만 비슷한 문제가 있었고 재부팅하면 문제가 해결되었습니다. 부팅 시 서비스가 시작된 후 정상적으로 중지하고 시작할 수 있었습니다.

답변2

순서대로 실행하면 작동했습니다. 서비스 iptables 저장 systemctl 방화벽 중지 systemctl 방화벽 비활성화 systemctl iptables 시작 systemctl 상태 iptables systemctl iptables 활성화

관련 정보