iptables

Conohaは、コントロールパネルに接続許可ポートが設定できるので、iptablesの設定をサボっていたが、必要に迫られて設定する。
基本インストールで、iptablesパッケージは設定されているので、ルールを設定して、サービスを起動するだけ。
cd /etc/iptables
cp simple_firewall.rules iptables.rules
systemctl start iptables
systemctl status iptables
iptables -L
systemctl enable iptables
vi iptables.rules
systemctl reload iptables

確認は、nmapでおこなうとよいが、localhostからのアクセスはオープンにしていることが多いので、外部からの状態の確認は、https://www.cman.jp/network/support/port.htmlなどの外部サービスを利用するしかない。
また、DHCPサーバーサービスの確認は、-sUのオプションが必要。
pacman -S nmap
nmap localhost ; scan tcp only
nmap -sU localhost; scan udp only

# ss -atunp; 使用中のtcpとutpポートを数字でプロセス名と表示
# pacman -S lsof; lsof -i -n -P; 使用中のプロセスを表示
これらで、不要なサービスを止める。

コメント