Linux Güvenlik Duvarı (Netfilter/iptables)
Trafiği filtrelemek ve sistemlerinizi güvenceye almak için `iptables` kullanan Linux güvenlik duvarlarının temellerini anlayın.
Linux Güvenlik Duvarı (Netfilter/iptables), CoddyKit'te ücretsiz bir Linux Networking & TCP/IP for Developers dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Linux Networking & TCP/IP for Developers öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Linux Networking & TCP/IP for Developers kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Firewalls: Your Network Guardian
What is a firewall? It's like a security guard for your network, controlling what traffic goes in and out. In Linux, the core firewall framework is called Netfilter. We use a command-line tool called iptables to manage its rules.
Netfilter: The Kernel's Core
Netfilter is a powerful framework built right into the Linux kernel. It allows different kernel modules to inspect, modify, and drop network packets.
Think of it as the engine behind the firewall. It provides "hooks" where packet processing can be intercepted.
`iptables`: Managing Firewall Rules
While Netfilter is in the kernel, iptables is the command-line utility you use to interact with it. It lets you define rules that tell Netfilter what to do with specific packets.
These rules are organized into tables and chains, which we'll explore next.
`iptables` Chains: Traffic Paths
iptables organizes rules into chains. These are ordered lists of rules that packets are checked against. The three most common built-in chains are:
- INPUT: For packets destined for the local system.
- OUTPUT: For packets originating from the local system.
- FORWARD: For packets passing through the system (e.g., a router).
Default Actions: Chain Policies
Each chain has a default policy, which is the action taken if no rule in the chain matches a packet. Common policies are:
- ACCEPT: Let the packet through.
- DROP: Silently discard the packet (sender gets no response).
- REJECT: Discard the packet and send an error message back to the sender.
It's common to set default policies to DROP for security.
Viewing Current `iptables` Rules
Before adding rules, it's good to see what's already there. You can list all current iptables rules with the -L option. Adding -n shows IP addresses numerically, and -v adds verbosity.
sudo iptables -L -n -vAllowing Inbound SSH Traffic
Let's add a rule to allow incoming SSH connections (port 22). We'll append (-A) this rule to the INPUT chain, specifying TCP protocol (-p tcp) and destination port (--dport 22). The action (-j) will be ACCEPT.
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPTBlocking Outbound Ping Requests
Now, let's block all outbound ping requests (ICMP protocol). We'll append this rule to the OUTPUT chain, specifying the ICMP protocol. The action will be DROP.
This means your system won't send ping requests, but might still receive them if not blocked on INPUT.
sudo iptables -A OUTPUT -p icmp -j DROPMaking Rules Permanent
iptables rules are volatile; they disappear on reboot! To make them permanent, you need to save them. On many systems, you'd use iptables-save to export rules and iptables-restore to load them.
Some Linux distributions use specific services (like netfilter-persistent) or files (e.g., /etc/sysconfig/iptables) to manage persistence.
Firewall Chains Check
Based on what you've learned, which iptables chain would typically handle network packets that are trying to reach a service running on your local machine?
Recap: `iptables` Firewall Basics
You've learned about Netfilter, the kernel's firewall framework, and iptables, the user-space tool to manage its rules. We covered the main chains (INPUT, OUTPUT, FORWARD) and policies (ACCEPT, DROP, REJECT).
You also saw how to list, add basic rules, and the importance of saving them for persistence. This is a crucial step in securing any Linux system!
Sıkça Sorulan Sorular
“Linux Güvenlik Duvarı (Netfilter/iptables)” dersi ücretsiz mi?
Evet — “Linux Güvenlik Duvarı (Netfilter/iptables)” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Linux Networking & TCP/IP for Developers kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Linux Networking & TCP/IP for Developers kursu toplamda 4 dersten oluşur.
“Linux Güvenlik Duvarı (Netfilter/iptables)” dersinde ne öğreneceğim?
Trafiği filtrelemek ve sistemlerinizi güvenceye almak için `iptables` kullanan Linux güvenlik duvarlarının temellerini anlayın. Linux Networking & TCP/IP for Developers ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Linux Networking & TCP/IP for Developers öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Linux Networking & TCP/IP for Developers, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.
“Linux Güvenlik Duvarı (Netfilter/iptables)” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Linux Networking & TCP/IP for Developers dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Linux Networking & TCP/IP for Developers dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Wireshark/tcpdump ile Paket Yakalama
- Ağ Performansı Araçları
- Linux Güvenlik Duvarı (Netfilter/iptables)
- dig ve nslookup ile DNS Tanılaması