firewalld
CentOS-7 CentOS 7 default to firewalld. It's not recommended to install iptables, please use firewalld yum install iptables system-config-firewall-tui setuptool firewalld default XML directory /usr/lib/firewalld and /etc/firewalld ===================================================== firewalld ========== >>> firewall-config ====> firewall-cmd <==== 在firewalld裡面, 是把網路分成幾個區域 (zone). 然後針對zone去設定過濾規則. 我們先看預設設定: [root@c7 ~]# firewall-cmd --get-active-zones public interfaces: eth0 eth1 所以目前兩個網卡都是被指定在public(對外區域). 然後看看預設public區域的規則: [root@c7 ~]# firewall-cmd --zone=public --list-all public (default, active) interfaces: eth0 eth1 sources: services: dhcpv6-client ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules: 所以public zone開了DHCP跟SSH服務, 沒有指定port, 沒有限制連線來源, 也沒有開啟NAT功能. DHCP我沒有在用, 所以移掉: [root@c7 ~]# firewall-cmd --zone=public --remove-service dhcpv6-cl...