在 CentOS 中通过 firewall-cmd 添加仅本地端口¶
文档时效性说明
本文为早期笔记,可能存在版本过时、命令失效、链接失效、最佳实践变化等问题。请以官方最新文档为准。
原英文标题:Add a localhost-only port in CentOS via firewall-cmd
1. Zone Manipulating¶
To see which zones are available on your system:
To see detailed information for all zones:
To see detailed information for a specific zone:
Assign the interface to a different zone:
2. Allow a port only on localhost¶
Assign loopback interface lo to trusted zone
Add a port to trusted zone
Reload