هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
الهدف
Open web services on server1, limit a database port to one network, block one host, and test from server2.
قبل أن تبدأ
- server1 runs httpd (lab 21.1). Work as root on server1.
المهام
ضع علامة على المهمة عندما تنتهي منها. متصفحك فقط يتذكر ذلك.
- Show the default zone, the active zones and everything open in the default zone.
- Open the services http and https permanently.
- Open port 5432/tcp only for the network 192.168.122.0/24 (rich rule).
- Drop all traffic from the address 192.168.122.99.
- Remove the service
cockpitfrom the default zone. - Test from server2 that HTTP works and that a closed port is refused.
تحقّق من عملك
firewall-cmd --list-all
firewall-cmd --list-rich-rules
curl -I http://server1
nc -zv server1 3306- services: dhcpv6-client http https ssh (no cockpit).
- Two rich rules: the 5432 accept and the drop for .99.
- curl works from server2; port 3306 is refused or times out.
تلميحات
اعرض التلميحات
--get-default-zone,--get-active-zones,--list-all.- Always
--permanentand then--reload. rule family="ipv4" source address="…" port port="5432" protocol="tcp" accept.
الحل
اعرض الحل
- Look around.
firewall-cmd --get-default-zone; firewall-cmd --get-active-zones; firewall-cmd --list-all - Web services.
firewall-cmd --add-service={http,https} --permanent - Database port for one network.
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.122.0/24" port port="5432" protocol="tcp" accept' - Block one host.
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.122.99" drop' - Remove cockpit and reload.
firewall-cmd --remove-service=cockpit --permanent firewall-cmd --reload - Test from server2.
curl -I http://server1 nc -zv server1 3306
ملاحظاتي
لا توجد ملاحظات بعد.