Запускаю сервер (гостевая CentOS7 на виртуалке). Связь через SSH c локальной на гостевую не устанавливается(в sshd_config изменил порт, правило для нового порта в iptables сохранено). Пишет ..connection refused.. 1.)На сервере проверяю статус:
[root@localhost ~]# systemctl status iptables -l
● iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
Active: active (exited) since Wed 2019-02-20 16:41:23 MSK; 10min ago
Process: 2598 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=0/SUCCESS)
Main PID: 2598 (code=exited, status=0/SUCCESS)
Tasks: 0
CGroup: /system.slice/iptables.service
Feb 20 16:41:17 localhost systemd[1]: Starting IPv4 firewall with iptables...
Feb 20 16:41:21 localhost iptables.init[2598]: iptables: Applying firewall rules: [ OK ]
Feb 20 16:41:23 localhost systemd[1]: Started IPv4 firewall with iptables.
2.) Запускаем (судя по статусу уже запущенный) iptables
[root@localhost ~]# systemctl start iptables
Связь появилась! С локальной машины захожу на сервер.
3.) Снова проверим статус. Статус не изменился, ничего не перезапускалось..
[root@localhost ~]# systemctl status iptables -l
● iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
Active: active (exited) since Wed 2019-02-20 16:41:23 MSK; 16min ago
Process: 2598 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=0/SUCCESS)
Main PID: 2598 (code=exited, status=0/SUCCESS)
Tasks: 0
CGroup: /system.slice/iptables.service
Feb 20 16:41:17 localhost systemd[1]: Starting IPv4 firewall with iptables...
Feb 20 16:41:21 localhost iptables.init[2598]: iptables: Applying firewall rules: [ OK ]
Feb 20 16:41:23 localhost systemd[1]: Started IPv4 firewall with iptables.
Автозапуск в systemctl включен и для sshd и для iptables, и они вроде запускаются. Но правило применяется только после того, как запустить iptables вручную. В чем может быть проблема? Как автоматизировать процесс?