الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

معمل 23.1RHCSA 10, الفصل 23

Configure firewalld zones and services

المستوى
متوسط
30 دقيقة
الأجهزة
server1, server2
الحالة
لم يبدأ

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

الهدف

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.

المهام

  1. Show the default zone, the active zones and everything open in the default zone.
  2. Open the services http and https permanently.
  3. Open port 5432/tcp only for the network 192.168.122.0/24 (rich rule).
  4. Drop all traffic from the address 192.168.122.99.
  5. Remove the service cockpit from the default zone.
  6. 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 --permanent and then --reload.
  • rule family="ipv4" source address="…" port port="5432" protocol="tcp" accept.

الحل

اعرض الحل
  1. Look around.
    firewall-cmd --get-default-zone; firewall-cmd --get-active-zones; firewall-cmd --list-all
  2. Web services.
    firewall-cmd --add-service={http,https} --permanent
  3. 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'
  4. Block one host.
    firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.122.99" drop'
  5. Remove cockpit and reload.
    firewall-cmd --remove-service=cockpit --permanent
    firewall-cmd --reload
  6. Test from server2.
    curl -I http://server1
    nc -zv server1 3306

ملاحظاتي

لا توجد ملاحظات بعد.

دروس هذا المعمل

الأوامر في هذا المعمل