[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"categories-en":3,"cheatsheet:\u002Fcheatsheets\u002Flinux-networking-the-hacker-guide":37},[4,11,17,24,30],{"id":5,"slug":6,"name":7,"colorHex":8,"iconName":9,"postCount":10},"0e2c1225-f78a-4c20-8c93-998ab9dc93b9","frontend","Frontend","#40484f",null,25,{"id":12,"slug":13,"name":14,"colorHex":15,"iconName":9,"postCount":16},"bc8df70e-b7fb-4d89-a80c-fd458d36d58c","code-development","Code & Development","#8b5cf6",23,{"id":18,"slug":19,"name":20,"colorHex":21,"iconName":22,"postCount":23},"550e8400-e29b-41d4-a716-446655440001","inteligencia-artificial","Artificial Intelligence","#6366f1","brain",14,{"id":25,"slug":26,"name":27,"colorHex":28,"iconName":9,"postCount":29},"ea63b69c-2eb4-4100-81f3-70ce52d33743","tech-news","Tech News","#e50606",4,{"id":31,"slug":32,"name":33,"colorHex":34,"iconName":35,"postCount":36},"550e8400-e29b-41d4-a716-446655440017","how-to-guides","How-To & Guides","#be123c","book-open",2,{"id":38,"slug":39,"title":40,"description":41,"category":42,"level":43,"codeLanguage":44,"views":45,"updatedAt":46,"tags":47,"sections":62,"snippetCount":591},"47c46046-46f3-4698-aff2-c1a2e24b0782","linux-networking-the-hacker-guide","Linux Networking: The Hacker Guide","Feel like Mr. Robot. Network commands to discover IPs, open ports and diagnose connections like a CyberSec professional.","devops","advanced","bash",11,"2026-08-21T15:20:17.609741+00:00",[48,49,42,50,51,52,53,54,55,56,57,58,59,60,61],"linux","network","troubleshooting","firewall","vpn","load balancing","performance","tcpdump","iptables","haproxy","wireguard","qos","system administration","security",[63,158,259,354,431,508],{"id":64,"title":65,"description":66,"snippets":67},"194794da-0502-4c27-9468-8544b73b55d0","🔍 Basic Diagnostics","Fundamental commands for diagnosing connectivity issues, checking network interface configurations, and resolving DNS-related questions. Essential for quick identification of network infrastructure failures.",[68,74,80,86,92,98,104,110,116,122,128,134,140,146,152],{"id":69,"title":70,"description":71,"code":72,"language":44,"filename":9,"whenToUse":9,"highlighted":73},"75a37833-2a5d-427f-9973-86283cfbf5fd","Test Connectivity with Ping","Tests network connectivity and the accessibility of a specific host by sending ICMP ECHO_REQUEST packets. The `-c 4` flag limits sending to 4 packets, providing a quick test without overloading the network.","ping -c 4 google.com","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">ping\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -c 4 google.com\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":75,"title":76,"description":77,"code":78,"language":44,"filename":9,"whenToUse":9,"highlighted":79},"c5e2be97-f2d3-4cf8-adea-98c23e5c3c70","Fast Ping with Reduced Interval","Performs a connectivity test with a reduced interval between packets. The `-i 0.5` flag sets an interval of 0.5 seconds between each ping, useful for quick latency tests and to check real-time response.","ping -i 0.5 192.168.1.1","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">ping\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -i 0.5 192.168.1.1\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":81,"title":82,"description":83,"code":84,"language":44,"filename":9,"whenToUse":9,"highlighted":85},"bff65a98-e805-4e06-b362-2a1ab2ad80ed","Trace Route to Destination (Traceroute)","Displays the route that IP packets take to reach a destination, showing each router (hop) along the path. Helps identify bottlenecks, excessive latency, or failures at specific points in the network route.","traceroute google.com","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">traceroute\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> google.com\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":87,"title":88,"description":89,"code":90,"language":44,"filename":9,"whenToUse":9,"highlighted":91},"a8a4e9ff-a0ef-4cfd-b269-e1145aecf348","Continuous Traceroute (MTR)","Combines the functionalities of `ping` and `traceroute` into a continuous tool. It displays latency and packet loss statistics for each hop in real-time, ideal for prolonged monitoring and identifying intermittent issues.","mtr google.com","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">mtr\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> google.com\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":93,"title":94,"description":95,"code":96,"language":44,"filename":9,"whenToUse":9,"highlighted":97},"7355324f-41e1-4ebf-a86b-2c2cfdafaa5c","Display ARP Table","Displays the system's ARP (Address Resolution Protocol) table, which maps IP addresses to MAC (physical) addresses on the local network. The `-a` flag shows all entries, useful for debugging layer 2 address resolution issues.","arp -a","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">arp\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -a\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":99,"title":100,"description":101,"code":102,"language":44,"filename":9,"whenToUse":9,"highlighted":103},"bcced7cc-6fa3-4963-8880-77e2ac70ab40","Display Interfaces and IP Addresses","Displays detailed information about all network interfaces configured on the system, including IP addresses, subnet masks, interface state (UP\u002FDOWN), and scope. It is the modern tool to replace `ifconfig`.","ip addr show","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">ip\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> addr show\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":105,"title":106,"description":107,"code":108,"language":44,"filename":9,"whenToUse":9,"highlighted":109},"6ebaec31-c9ff-4844-ad5b-865b543f36a3","Activate Network Interface","Activates the `eth0` network interface. Replace `eth0` with the desired interface name (e.g., `enp0s3`, `wlan0`). Use `ip link set eth0 down` to deactivate it. Requires root privileges.","ip link set eth0 up","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">ip\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> link set eth0 up\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":111,"title":112,"description":113,"code":114,"language":44,"filename":9,"whenToUse":9,"highlighted":115},"fd2b5753-e3af-442c-beef-95c519cfad6c","Interface Details with Ethtool","Displays and allows configuration of low-level parameters for the `eth0` network interface, such as speed, duplex mode, auto-negotiation, and hardware statistics. Useful for checking the physical connection state.","ethtool eth0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">ethtool\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> eth0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":117,"title":118,"description":119,"code":120,"language":44,"filename":9,"whenToUse":9,"highlighted":121},"4ed1a378-5ee0-43c6-b0d4-2385cd220ff6","Network Interface Statistics","Shows concise traffic statistics (bytes sent\u002Freceived, errors, dropped packets) for the `eth0` network interface. The `-s` flag displays a summary of packet and error statistics.","ip -s link show eth0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">ip\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -s link show eth0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":123,"title":124,"description":125,"code":126,"language":44,"filename":9,"whenToUse":9,"highlighted":127},"b8bd66f2-50f5-4f59-9916-9da7bddbde2c","List Open Ports (Sockets)","Displays information about open network sockets on the system. The flags `-t` (TCP), `-u` (UDP), `-l` (listening sockets), and `-n` (numeric, no name resolution) are commonly used to list ports awaiting connections.","ss -tuln","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">ss\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -tuln\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":129,"title":130,"description":131,"code":132,"language":44,"filename":9,"whenToUse":9,"highlighted":133},"465881b6-5525-4b1c-ac29-2c00ce3bbb42","DNS Query with Nslookup","Queries DNS servers for domain name information, such as IP addresses (A records) and other record types. It's an older tool but still useful for basic and quick DNS queries.","nslookup google.com","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">nslookup\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> google.com\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":135,"title":136,"description":137,"code":138,"language":44,"filename":9,"whenToUse":9,"highlighted":139},"e73db5ce-157a-481d-ad89-37f6042bd998","Complete DNS Query with Dig","A more powerful and flexible tool for DNS queries. `ANY` requests all available DNS record types for the specified domain, including A, MX, NS, SOA, etc. Ideal for advanced DNS debugging.","dig google.com ANY","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">dig\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> google.com ANY\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":141,"title":142,"description":143,"code":144,"language":44,"filename":9,"whenToUse":9,"highlighted":145},"71f75eba-98ed-440f-a1be-b21c53e94481","Trace DNS Resolution Path","Traces the DNS resolution path for a domain, showing the root, TLD, and authoritative DNS servers queried at each step. Useful for understanding how a name is resolved globally and identifying delegation issues.","dig +trace google.com","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">dig\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> +trace google.com\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":147,"title":148,"description":149,"code":150,"language":44,"filename":9,"whenToUse":9,"highlighted":151},"c565e0ef-8734-4c0e-9996-7b1db32d991b","Query MX Records with Host","Queries DNS servers for information about a domain. The `-t mx` flag specifically requests MX (Mail Exchanger) records, which indicate the email servers responsible for receiving messages for the domain.","host -t mx google.com","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">host\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -t mx google.com\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":153,"title":154,"description":155,"code":156,"language":44,"filename":9,"whenToUse":9,"highlighted":157},"fb701f60-d6d6-4bf1-a40e-6e8e7ceb0255","Systemd-Resolved DNS Status","Displays the current status of the system's DNS resolver managed by `systemd-resolved`, including configured DNS servers, interfaces, and search domains. Relevant on systems using `systemd` for network management.","systemd-resolve --status","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">systemd-resolve\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> --status\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":159,"title":160,"description":161,"snippets":162},"4dd236d3-a3c1-46bd-905b-bf32a62b6063","📊 Traffic Analysis","Commands for capturing, filtering, and analyzing network packets, plus real-time traffic monitoring to identify patterns, anomalies, and performance issues.",[163,169,175,181,187,193,199,205,211,217,223,229,235,241,247,253],{"id":164,"title":165,"description":166,"code":167,"language":44,"filename":9,"whenToUse":9,"highlighted":168},"83774b55-29ee-4021-911f-e4e92ff89ba5","Capturar Tráfego na Interface (tcpdump)","Captura e exibe o tráfego de rede passando pela interface `eth0` em tempo real. Requer privilégios de root. Use `Ctrl+C` para parar a captura. É uma ferramenta fundamental para inspeção de pacotes.","sudo tcpdump -i eth0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tcpdump -i eth0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":170,"title":171,"description":172,"code":173,"language":44,"filename":9,"whenToUse":9,"highlighted":174},"a679d221-7a44-4c7f-9603-00a86b87f299","Capture Traffic without DNS Resolution","Captures traffic on the `eth0` interface without resolving IP addresses to hostnames or port numbers to service names. The `-n` flag speeds up display and is useful in environments without DNS access or to focus only on IPs.","sudo tcpdump -i eth0 -n","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tcpdump -i eth0 -n\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":176,"title":177,"description":178,"code":179,"language":44,"filename":9,"whenToUse":9,"highlighted":180},"d909694c-5abd-4249-bbd8-a22e8f599e48","Filter Traffic by Port","Filters traffic on the `eth0` interface to show only packets using port 80 (usually HTTP). The filter can be applied to source or destination ports, facilitating the analysis of specific services.","sudo tcpdump -i eth0 port 80","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tcpdump -i eth0 port 80\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":182,"title":183,"description":184,"code":185,"language":44,"filename":9,"whenToUse":9,"highlighted":186},"331c7269-0835-4574-ad55-93975f3e79fa","Filter Traffic by Specific Host","Captures only traffic originating from or destined for the IP address `192.168.1.100` on the `eth0` interface. Essential for isolating traffic from a single device or server.","sudo tcpdump -i eth0 host 192.168.1.100","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tcpdump -i eth0 host 192.168.1.100\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":188,"title":189,"description":190,"code":191,"language":44,"filename":9,"whenToUse":9,"highlighted":192},"400e5796-b8e7-4e3e-ae15-7d906a9f34c3","Save Capture to PCAP File","Captures traffic from the `eth0` interface and saves the raw packets to a file named `capture.pcap`. This file can later be analyzed with `tcpdump` or graphical tools like `Wireshark`.","sudo tcpdump -i eth0 -w capture.pcap","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tcpdump -i eth0 -w capture.pcap\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":194,"title":195,"description":196,"code":197,"language":44,"filename":9,"whenToUse":9,"highlighted":198},"6ff68cab-fe8e-4320-9c3f-29a06c1af652","Read PCAP File with ASCII Content","Reads and displays the content of a previously saved capture file (`.pcap`). The `-A` flag attempts to print each packet (excluding the link-layer header) in ASCII, useful for inspecting text data within packets.","sudo tcpdump -r capture.pcap -A","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tcpdump -r capture.pcap -A\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":200,"title":201,"description":202,"code":203,"language":44,"filename":9,"whenToUse":9,"highlighted":204},"ab02482b-0ded-4189-92e2-0b070afd9504","Real-time Capture with Tshark","Starts real-time packet capture on the `eth0` interface using `tshark`, the command-line version of Wireshark. Offers more advanced filtering and analysis capabilities than `tcpdump`.","tshark -i eth0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">tshark\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -i eth0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":206,"title":207,"description":208,"code":209,"language":44,"filename":9,"whenToUse":9,"highlighted":210},"8f782f7b-9757-442f-b2d6-314f9a61ebea","Analyze PCAP File with Tshark","Reads and displays the content of a capture file (`.pcap`) using `tshark`. Allows applying display filters and performing detailed analysis of recorded packets.","tshark -r capture.pcap","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">tshark\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -r capture.pcap\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":212,"title":213,"description":214,"code":215,"language":44,"filename":9,"whenToUse":9,"highlighted":216},"01bd54f8-b5e6-4da8-a141-468e9997725a","Filter HTTP Requests in PCAP","Analyzes a `.pcap` file and displays only packets matching the Wireshark display filter `http.request`, showing captured HTTP requests in detail.","tshark -r capture.pcap -Y \"http.request\"","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">tshark\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -r capture.pcap -Y \"http.request\"\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":218,"title":219,"description":220,"code":221,"language":44,"filename":9,"whenToUse":9,"highlighted":222},"ededfd66-40a7-4f45-bf53-d7f9cbe49b37","Extract Source\u002FDestination IPs from PCAP","Extracts and displays specific packet fields from a `.pcap` file. `-T fields` specifies the output format as fields, and `-e` lists the fields to be extracted (in this case, source and destination IP addresses).","tshark -r capture.pcap -T fields -e ip.src -e ip.dst","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">tshark\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -r capture.pcap -T fields -e ip.src -e ip.dst\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":224,"title":225,"description":226,"code":227,"language":44,"filename":9,"whenToUse":9,"highlighted":228},"c8ad99ab-efcc-4f21-b927-6ea1c2cc5fa6","IP Conversation Statistics with Tshark","Analyzes a `.pcap` file and generates IP conversation statistics. `-q` suppresses packet output, and `-z conv,ip` enables the IP conversation statistician, showing data and packet volume between IP pairs.","tshark -r capture.pcap -q -z conv,ip","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">tshark\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -r capture.pcap -q -z conv,ip\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":230,"title":231,"description":232,"code":233,"language":44,"filename":9,"whenToUse":9,"highlighted":234},"6f33ad40-a08c-4803-b712-272f5a273a11","Monitor Real-time Traffic (iftop)","Displays real-time bandwidth usage for the `eth0` interface, showing connections consuming the most bandwidth, ordered by volume. Requires `sudo` and `iftop` installation.","iftop -i eth0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">iftop\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -i eth0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":236,"title":237,"description":238,"code":239,"language":44,"filename":9,"whenToUse":9,"highlighted":240},"3f4a35d3-c120-4911-9769-237a97ed90b8","Monitor Traffic by Process (nethogs)","Shows bandwidth consumption per process on the `eth0` interface. Useful for identifying which applications are generating the most network traffic in real-time. Requires `sudo` and `nethogs` installation.","nethogs eth0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">nethogs\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> eth0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":242,"title":243,"description":244,"code":245,"language":44,"filename":9,"whenToUse":9,"highlighted":246},"2fde0668-3e9e-48f3-8e55-645523cf4a95","Graphical Bandwidth Monitor (bmon)","A bandwidth and network statistics monitor that offers a graphical and detailed view of traffic on all interfaces. Provides an interactive interface for visualizing network metrics. Requires `bmon` installation.","bmon","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">bmon\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":248,"title":249,"description":250,"code":251,"language":44,"filename":9,"whenToUse":9,"highlighted":252},"b6edb8ac-89a8-48e8-88b8-2bf21a394900","Detailed Network Statistics (iptraf-ng)","An interactive network monitoring tool that collects and displays a variety of statistics, including IP, TCP, UDP, ICMP, Ethernet information, and more. Useful for in-depth traffic analysis. Requires `iptraf-ng` installation.","iptraf-ng","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">iptraf-ng\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":254,"title":255,"description":256,"code":257,"language":44,"filename":9,"whenToUse":9,"highlighted":258},"5efb6943-fa22-4d44-88f3-cfc93dddcf78","Network Statistics with Sar","Collects, reports, or saves system activity information. `-n DEV` specifies the network statistics report per device, `1` is the interval in seconds, and `5` is the number of samples to collect. Part of the `sysstat` package.","sar -n DEV 1 5","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sar\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -n DEV 1 5\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":260,"title":261,"description":262,"snippets":263},"d920d7bb-80db-4792-a7ea-82b0b98e3442","🔒 Firewall and Security","Commands for configuring and managing firewalls (UFW, iptables) and protecting the system against attacks with tools like Fail2Ban.",[264,270,276,282,288,294,300,306,312,318,324,330,336,342,348],{"id":265,"title":266,"description":267,"code":268,"language":44,"filename":9,"whenToUse":9,"highlighted":269},"8a1ca4a8-d068-4ab3-8c65-ebb84e16126f","Enable UFW Firewall","Enables the UFW (Uncomplicated Firewall) firewall. Make sure to have SSH access rules configured before enabling it on remote servers to avoid blocking access. Requires root privileges.","sudo ufw enable","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ufw enable\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":271,"title":272,"description":273,"code":274,"language":44,"filename":9,"whenToUse":9,"highlighted":275},"b4244878-6284-4a71-a4c2-f29096f47013","Detailed UFW Status","Displays the current UFW status, showing if it's active, configured rules, default profile, and rule log. The `verbose` flag provides more details about rules and traffic.","sudo ufw status verbose","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ufw status verbose\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":277,"title":278,"description":279,"code":280,"language":44,"filename":9,"whenToUse":9,"highlighted":281},"10e1ced6-7072-45eb-ac05-91b0e46168f6","Allow SSH Connection (UFW)","Creates a rule to allow TCP connections on port 22 (SSH). It is crucial to allow SSH before enabling the firewall on remote servers to maintain administrative access.","sudo ufw allow 22\u002Ftcp","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ufw allow 22\u002Ftcp\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":283,"title":284,"description":285,"code":286,"language":44,"filename":9,"whenToUse":9,"highlighted":287},"57e81613-bf47-48ea-b384-47daba52d058","Block Specific IP (UFW)","Creates a rule to block all incoming connections from the IP address `192.168.1.100`. Useful for mitigating attacks or blocking unwanted access from a known IP.","sudo ufw deny from 192.168.1.100","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ufw deny from 192.168.1.100\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":289,"title":290,"description":291,"code":292,"language":44,"filename":9,"whenToUse":9,"highlighted":293},"c9e1eaad-d649-4a90-96cd-daebda5e4b19","Remove UFW Rule","Removes an existing rule that allows traffic on port 80. To remove a specific rule, you can use `ufw status numbered` to see the rules with numbers and then `ufw delete \u003Cnumber>`.","sudo ufw delete allow 80","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ufw delete allow 80\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":295,"title":296,"description":297,"code":298,"language":44,"filename":9,"whenToUse":9,"highlighted":299},"4a64fafc-becd-4abe-9f3d-c92ff66fff02","Reload UFW Rules","Reloads UFW rules after modifications, applying the new configurations without the need to restart the service. This ensures that changes take effect immediately.","sudo ufw reload","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ufw reload\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":301,"title":302,"description":303,"code":304,"language":44,"filename":9,"whenToUse":9,"highlighted":305},"633790ae-9940-46e1-8fc2-e120c49c99b4","List Iptables Rules","Lists all `iptables` firewall rules. `-L` lists the rules, `-n` displays addresses and ports numerically (without DNS resolution for faster speed), and `-v` shows details like packet\u002Fbyte counters.","sudo iptables -L -n -v","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> iptables -L -n -v\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":307,"title":308,"description":309,"code":310,"language":44,"filename":9,"whenToUse":9,"highlighted":311},"25ed97a0-de4e-4d47-a4ad-1925e4022f52","Allow Specific Port (Iptables)","Adds (`-A`) a rule to the `INPUT` chain to allow (`-j ACCEPT`) TCP connections (`-p tcp`) destined for port 22 (`--dport 22`). This rule allows incoming SSH traffic.","sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> iptables -A INPUT -p tcp --dport 22 -j ACCEPT\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":313,"title":314,"description":315,"code":316,"language":44,"filename":9,"whenToUse":9,"highlighted":317},"a1803c0e-e0df-48bf-8725-0885d213e1f1","Block Subnet (Iptables)","Adds a rule to the `INPUT` chain to drop (`-j DROP`) all packets originating from the `192.168.1.0\u002F24` subnet. Useful for isolating or blocking traffic from a specific network.","sudo iptables -A INPUT -s 192.168.1.0\u002F24 -j DROP","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> iptables -A INPUT -s 192.168.1.0\u002F24 -j DROP\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":319,"title":320,"description":321,"code":322,"language":44,"filename":9,"whenToUse":9,"highlighted":323},"e64968e6-4cef-4f34-8f8d-c0ecf3f7449f","Clear All Iptables Rules","Clears (`-F`, flush) all rules from all `iptables` chains. Use with extreme caution, as this can open your system to all traffic and compromise security.","sudo iptables -F","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> iptables -F\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":325,"title":326,"description":327,"code":328,"language":44,"filename":9,"whenToUse":9,"highlighted":329},"71084211-2497-499b-b81f-b29d1ac2d988","Save Iptables Rules","Saves the current `iptables` rules to a file. In many systems, this file is used to restore rules on system startup, ensuring firewall configuration persistence.","sudo iptables-save > \u002Fetc\u002Fiptables\u002Frules.v4","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> iptables-save > \u002Fetc\u002Fiptables\u002Frules.v4\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":331,"title":332,"description":333,"code":334,"language":44,"filename":9,"whenToUse":9,"highlighted":335},"6cbc2475-3931-4a2c-b40c-fc7b33ec3298","Fail2Ban General Status","Displays the general status of the Fail2Ban service, including which \"jails\" (monitored services, such as SSH, Apache) are active and the total number of banned IPs.","sudo fail2ban-client status","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> fail2ban-client status\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":337,"title":338,"description":339,"code":340,"language":44,"filename":9,"whenToUse":9,"highlighted":341},"45436513-e905-452f-a242-013643ee41e3","Specific SSHd Jail Status (Fail2Ban)","Shows the specific status of the `sshd` \"jail\", including how many IPs have been banned and which IPs are currently banned for the SSH service. Useful for monitoring brute-force attempts.","sudo fail2ban-client status sshd","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> fail2ban-client status sshd\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":343,"title":344,"description":345,"code":346,"language":44,"filename":9,"whenToUse":9,"highlighted":347},"0ddd6607-b42b-46eb-add7-b5c145eebefe","Unban IP with Fail2Ban","Manually unbans an IP address (`192.168.1.100`) from the `sshd` \"jail\". Useful if a legitimate IP was accidentally blocked or if access needs to be quickly restored.","sudo fail2ban-client set sshd unbanip 192.168.1.100","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> fail2ban-client set sshd unbanip 192.168.1.100\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":349,"title":350,"description":351,"code":352,"language":44,"filename":9,"whenToUse":9,"highlighted":353},"e29fb6ce-e38a-4c1d-94a0-3e1a41be84df","Reload Fail2Ban Configuration","Reloads the Fail2Ban configuration, applying any changes made to configuration files (e.g., `jail.local`) without needing to restart the full service.","sudo fail2ban-client reload","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> fail2ban-client reload\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":355,"title":356,"description":357,"snippets":358},"e2f60339-d4ea-4aeb-817f-b83a9b9ab9a1","⚖️ Load Balancing","Commands for managing and monitoring load balancing solutions like HAProxy, Nginx, and IPVS, ensuring efficient traffic distribution and high availability.",[359,365,371,377,383,389,395,401,407,413,419,425],{"id":360,"title":361,"description":362,"code":363,"language":44,"filename":9,"whenToUse":9,"highlighted":364},"7da73c07-84c0-4be1-ab3c-1e5d8a283d49","Validate HAProxy Configuration","Validates the syntax of the HAProxy configuration file (`\u002Fetc\u002Fhaproxy\u002Fhaproxy.cfg`) without starting or restarting the service. Essential to prevent errors before applying changes in production.","haproxy -f \u002Fetc\u002Fhaproxy\u002Fhaproxy.cfg -c","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">haproxy\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -f \u002Fetc\u002Fhaproxy\u002Fhaproxy.cfg -c\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":366,"title":367,"description":368,"code":369,"language":44,"filename":9,"whenToUse":9,"highlighted":370},"691c06dd-2e16-4358-a824-5b282d69dcc9","Restart HAProxy Service","Restarts the HAProxy service. This applies new configurations and may cause a brief service interruption, depending on the high availability configuration.","sudo systemctl restart haproxy","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> systemctl restart haproxy\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":372,"title":373,"description":374,"code":375,"language":44,"filename":9,"whenToUse":9,"highlighted":376},"91688cde-8559-4cf9-9104-86a6ad64e814","HAProxy Information via Socket","Displays general information about the HAProxy runtime state, such as version, uptime, number of processes, and session statistics. Requires `socat` and access to the HAProxy control socket.","echo \"show info\" | socat stdio \u002Fvar\u002Frun\u002Fhaproxy.sock","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">echo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> \"show info\" | socat stdio \u002Fvar\u002Frun\u002Fhaproxy.sock\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":378,"title":379,"description":380,"code":381,"language":44,"filename":9,"whenToUse":9,"highlighted":382},"4c15c25b-a7fb-41ab-926c-754e1c4638fe","HAProxy Statistics via Socket","Displays detailed statistics about frontends, backends, and servers, including active connections, sessions, request rates, and errors. Useful for performance and server health monitoring.","echo \"show stat\" | socat stdio \u002Fvar\u002Frun\u002Fhaproxy.sock","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">echo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> \"show stat\" | socat stdio \u002Fvar\u002Frun\u002Fhaproxy.sock\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":384,"title":385,"description":386,"code":387,"language":44,"filename":9,"whenToUse":9,"highlighted":388},"035d1f8c-c387-4d6b-86d2-3423d69b936f","Test Nginx Configuration","Tests the syntax of the Nginx configuration file. It is crucial to run this command before reloading or restarting Nginx to ensure there are no configuration errors that could bring down the service.","nginx -t","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">nginx\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -t\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":390,"title":391,"description":392,"code":393,"language":44,"filename":9,"whenToUse":9,"highlighted":394},"bf19b45e-85f5-4c57-b0f3-ab9c8c4fbf65","Reload Nginx Configuration","Reloads the Nginx configuration without dropping existing connections. It is the preferred way to apply configuration changes to a production Nginx server, ensuring zero downtime.","sudo nginx -s reload","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> nginx -s reload\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":396,"title":397,"description":398,"code":399,"language":44,"filename":9,"whenToUse":9,"highlighted":400},"d64eb17f-2a4b-4ba7-96b1-f4f70979af58","Nginx Load Balancer Status","Makes an HTTP HEAD request to the Nginx status URL (if configured), displaying metrics such as active connections, accepted connections, and handled connections. Requires the `ngx_http_stub_status_module` module.","curl -I http:\u002F\u002Flocalhost\u002Fnginx_status","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">curl\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -I http:\u002F\u002Flocalhost\u002Fnginx_status\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":402,"title":403,"description":404,"code":405,"language":44,"filename":9,"whenToUse":9,"highlighted":406},"1b44d09e-4bec-41ab-bcf8-a012deeb434d","Monitor Nginx Access Logs","Monitors the Nginx access log file in real-time, showing HTTP requests as they arrive at the server. Useful for debugging, traffic observation, and identifying access patterns.","tail -f \u002Fvar\u002Flog\u002Fnginx\u002Faccess.log","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">tail\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -f \u002Fvar\u002Flog\u002Fnginx\u002Faccess.log\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":408,"title":409,"description":410,"code":411,"language":44,"filename":9,"whenToUse":9,"highlighted":412},"89740f11-a5f3-4ecd-ad24-774fb95f2085","List IPVS Rules (Linux Virtual Server)","Lists all virtual service and real server rules configured in IPVS (Linux Virtual Server). `-n` prevents name resolution for IPs and ports, making the output faster and more concise.","sudo ipvsadm -L -n","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ipvsadm -L -n\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":414,"title":415,"description":416,"code":417,"language":44,"filename":9,"whenToUse":9,"highlighted":418},"4420adab-3ea0-4880-9df2-4e2115013ecf","Add IPVS Virtual Service","Adds (`-A`) a TCP virtual service (`-t`) at address `192.168.1.100` on port 80, using the `rr` (round-robin) scheduling algorithm to distribute the load among real servers.","sudo ipvsadm -A -t 192.168.1.100:80 -s rr","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ipvsadm -A -t 192.168.1.100:80 -s rr\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":420,"title":421,"description":422,"code":423,"language":44,"filename":9,"whenToUse":9,"highlighted":424},"62d688cd-4663-4c2c-b017-235552303d16","Add Real Server to IPVS","Adds (`-a`) a real server (`-r`) with IP `192.168.1.101` and port 80 to the virtual service `192.168.1.100:80`, using the `masquerading` (`-m`) routing method.","sudo ipvsadm -a -t 192.168.1.100:80 -r 192.168.1.101:80 -m","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ipvsadm -a -t 192.168.1.100:80 -r 192.168.1.101:80 -m\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":426,"title":427,"description":428,"code":429,"language":44,"filename":9,"whenToUse":9,"highlighted":430},"8a8b552a-91a3-4934-b545-6824599c038c","IPVS Connection Rate","Lists IPVS rules, including connection and traffic rates for each virtual service and real server, providing real-time performance and usage metrics.","sudo ipvsadm -L --rate","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ipvsadm -L --rate\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":432,"title":433,"description":434,"snippets":435},"9c4d8e65-8618-47b8-a693-722131d94432","🔐 VPN","Commands for configuring, managing, and monitoring VPN connections using OpenVPN, WireGuard, and IPSec (strongSwan) for secure communications.",[436,442,448,454,460,466,472,478,484,490,496,502],{"id":437,"title":438,"description":439,"code":440,"language":44,"filename":9,"whenToUse":9,"highlighted":441},"93298f18-b8f4-496d-aadb-c892a77f4528","OpenVPN Service Status","Checks the status of the OpenVPN service. On `systemd`-based systems, it shows whether the OpenVPN server or client is running, its uptime, and recent activity. Useful for debugging.","sudo systemctl status openvpn","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> systemctl status openvpn\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":443,"title":444,"description":445,"code":446,"language":44,"filename":9,"whenToUse":9,"highlighted":447},"9867e306-8e32-4b70-8231-0eaf769d9eee","Connect OpenVPN Client","Initiates an OpenVPN connection as a client, using the `client.ovpn` configuration file. This command is executed on the client side to establish the secure VPN tunnel.","openvpn --config client.ovpn","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">openvpn\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> --config client.ovpn\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":449,"title":450,"description":451,"code":452,"language":44,"filename":9,"whenToUse":9,"highlighted":453},"e6832d05-efd1-45b6-9053-ef28552d0fa3","Start OpenVPN Server in Daemon","Starts the OpenVPN server in the background (`--daemon`), using the `server.conf` configuration file. Requires root privileges. The server listens for client connections.","sudo openvpn --config server.conf --daemon","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> openvpn --config server.conf --daemon\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":455,"title":456,"description":457,"code":458,"language":44,"filename":9,"whenToUse":9,"highlighted":459},"19ddaaa7-6ee2-46ee-b64b-e514026e7fee","Monitor OpenVPN Logs","Monitors the OpenVPN log file in real-time, which records connection events, authentication, errors, and disconnections. Essential for VPN debugging and auditing.","tail -f \u002Fvar\u002Flog\u002Fopenvpn.log","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">tail\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -f \u002Fvar\u002Flog\u002Fopenvpn.log\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":461,"title":462,"description":463,"code":464,"language":44,"filename":9,"whenToUse":9,"highlighted":465},"d533c99f-16fe-460e-be4c-398916aff236","Generate WireGuard Keys","Generates a pair of cryptographic keys (private and public) for WireGuard. The private key is saved to `private.key` and the public key to `public.key`. Essential for peer configuration.","wg genkey | tee private.key | wg pubkey > public.key","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">wg\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> genkey | tee private.key | wg pubkey > public.key\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":467,"title":468,"description":469,"code":470,"language":44,"filename":9,"whenToUse":9,"highlighted":471},"fb04144a-c3d7-487c-ad3c-4223abb19c03","Activate WireGuard Interface","Activates the WireGuard interface `wg0` (or the configured name), establishing the VPN connection according to the configuration in `\u002Fetc\u002Fwireguard\u002Fwg0.conf`. Requires root privileges.","sudo wg-quick up wg0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> wg-quick up wg0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":473,"title":474,"description":475,"code":476,"language":44,"filename":9,"whenToUse":9,"highlighted":477},"2a4f2319-9947-4387-9bf7-2a9a5f6a388b","WireGuard VPN Status","Displays the current status of all active WireGuard interfaces, including public keys, connected peers, IP addresses, and data traffic. Useful for checking connectivity and configuration.","sudo wg show","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> wg show\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":479,"title":480,"description":481,"code":482,"language":44,"filename":9,"whenToUse":9,"highlighted":483},"493e4985-f988-4291-a594-84ea0fd5d0ef","Deactivate WireGuard Interface","Deactivates the WireGuard interface `wg0`, terminating the VPN connection and removing associated network configurations. Requires root privileges.","sudo wg-quick down wg0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> wg-quick down wg0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":485,"title":486,"description":487,"code":488,"language":44,"filename":9,"whenToUse":9,"highlighted":489},"cd2af9db-e462-4c1f-947f-089d9cfacc1e","IPSec Status (strongSwan)","Displays the general status of the strongSwan IPSec service, including information about configured connections, established tunnels, peers, and traffic statistics. Useful for monitoring and debugging.","sudo ipsec status","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ipsec status\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":491,"title":492,"description":493,"code":494,"language":44,"filename":9,"whenToUse":9,"highlighted":495},"489bd642-f019-4c2c-97fc-f1539caecf4f","Start IPSec Connection","Starts a specific IPSec connection, identified by `connection-name`, as configured in strongSwan files (e.g., `ipsec.conf`). Establishes the VPN tunnel.","sudo ipsec up connection-name","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ipsec up connection-name\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":497,"title":498,"description":499,"code":500,"language":44,"filename":9,"whenToUse":9,"highlighted":501},"82b23219-7701-42f1-9d95-50ed9a9321b7","Terminate IPSec Connection","Terminates a specific IPSec connection, releasing associated resources and the VPN tunnel. Disconnects the client or server from the VPN.","sudo ipsec down connection-name","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ipsec down connection-name\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":503,"title":504,"description":505,"code":506,"language":44,"filename":9,"whenToUse":9,"highlighted":507},"538c4ff5-ef47-4c16-92a8-b8a988277ceb","Reload IPSec Configuration","Reloads the strongSwan configuration without restarting the daemon, applying any changes made to the IPSec configuration files. Ensures new rules take effect.","sudo ipsec reload","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> ipsec reload\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":509,"title":510,"description":511,"snippets":512},"3e8d97bf-9a97-4e67-bbec-fe77c0d4c142","⚡ Performance and Optimization","Commands for tuning kernel network parameters, configuring Quality of Service (QoS), and running performance tests to optimize throughput and latency.",[513,519,525,531,537,543,549,555,561,567,573,579,585],{"id":514,"title":515,"description":516,"code":517,"language":44,"filename":9,"whenToUse":9,"highlighted":518},"3fedbd24-49ee-417d-b689-3859c6c0d410","Display Maximum Receive Buffer","Displays the maximum socket receive buffer value in bytes for all connections. Adjusting this value can improve performance on high-bandwidth and high-latency networks, allowing the system to store more data before processing it.","sysctl net.core.rmem_max","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sysctl\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> net.core.rmem_max\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":520,"title":521,"description":522,"code":523,"language":44,"filename":9,"whenToUse":9,"highlighted":524},"77abcbc7-24fc-4532-9704-84f606fc015a","Display Maximum Send Buffer","Displays the maximum socket send buffer value in bytes for all connections. Similar to `rmem_max`, its adjustment can optimize send throughput, especially in high-demand scenarios.","sysctl net.core.wmem_max","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sysctl\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> net.core.wmem_max\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":526,"title":527,"description":528,"code":529,"language":44,"filename":9,"whenToUse":9,"highlighted":530},"b15690bc-93cd-490c-9b39-a8a464c8e2df","TCP Congestion Control Algorithm","Displays the TCP congestion control algorithm currently in use (e.g., `cubic`, `bbr`). The choice of algorithm can significantly impact network performance, especially on links with packet loss or high latency.","sysctl net.ipv4.tcp_congestion_control","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sysctl\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> net.ipv4.tcp_congestion_control\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":532,"title":533,"description":534,"code":535,"language":44,"filename":9,"whenToUse":9,"highlighted":536},"b5a4fa5b-6df0-4fe2-ae8a-f9b0b8bcf329","TCP Listen Queue Size","Displays the maximum listen queue size for TCP sockets. A low value can lead to refused connections (connection refused) on servers with high request volumes, as new connections cannot be queued.","sysctl net.core.somaxconn","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sysctl\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> net.core.somaxconn\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":538,"title":539,"description":540,"code":541,"language":44,"filename":9,"whenToUse":9,"highlighted":542},"4342e2a9-bff4-4985-a895-11eba1a09a26","Display Traffic Queue (Qdisc)","Displays the queueing disciplines (qdisc) configured for the `eth0` network interface. Qdiscs are used to manage how packets are queued and transmitted, forming the basis of QoS.","tc qdisc show dev eth0","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">tc\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> qdisc show dev eth0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":544,"title":545,"description":546,"code":547,"language":44,"filename":9,"whenToUse":9,"highlighted":548},"9eaa3ea5-8768-40d0-910d-79704ad5b2ad","Create HTB Qdisc for QoS","Creates a Hierarchical Token Bucket (HTB) queueing discipline as `root` on the `eth0` interface, with handle `1:` and default class `30`. HTB is used for hierarchical bandwidth control, allowing prioritization and limitation.","sudo tc qdisc add dev eth0 root handle 1: htb default 30","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tc qdisc add dev eth0 root handle 1: htb default 30\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":550,"title":551,"description":552,"code":553,"language":44,"filename":9,"whenToUse":9,"highlighted":554},"f6ba612d-0d45-4d14-a063-69cb652093bd","Limit Bandwidth with HTB Class","Adds an HTB class (`classid 1:1`) under the parent qdisc `1:` on the `eth0` interface, limiting the egress rate to 1 Megabit per second (`rate 1mbit`). This allows controlling the available bandwidth for specific traffic.","sudo tc class add dev eth0 parent 1: classid 1:1 htb rate 1mbit","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tc class add dev eth0 parent 1: classid 1:1 htb rate 1mbit\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":556,"title":557,"description":558,"code":559,"language":44,"filename":9,"whenToUse":9,"highlighted":560},"2c76df41-5f6e-4657-9b9a-c7b24a74275b","Filter Traffic by Port for QoS","Adds a filter to direct destination IP traffic on port 80 (`dport 80`) to class `1:10` (which must be previously defined with a rate or priority). `u32` is a powerful classifier for complex filtering rules.","sudo tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80 0xffff flowid 1:10","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80 0xffff flowid 1:10\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":562,"title":563,"description":564,"code":565,"language":44,"filename":9,"whenToUse":9,"highlighted":566},"2a1f9c81-dc26-46d4-93d4-ce7602d0fb77","Remove QoS Configuration","Removes the root queuing discipline (`root`) from the `eth0` interface, disabling all QoS rules configured for that interface. This restores the default queuing behavior.","sudo tc qdisc del dev eth0 root","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">sudo\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tc qdisc del dev eth0 root\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":568,"title":569,"description":570,"code":571,"language":44,"filename":9,"whenToUse":9,"highlighted":572},"899fa19f-3663-4e45-9e36-43ddc45b3b90","Start Iperf3 Server","Starts the `iperf3` server, which awaits client connections to perform network throughput tests. The server listens on the default port 5201. Essential for measuring bandwidth between two points.","iperf3 -s","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">iperf3\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -s\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":574,"title":575,"description":576,"code":577,"language":44,"filename":9,"whenToUse":9,"highlighted":578},"98cead6d-d76a-4896-b19c-33cc9825b41a","Throughput Test with Iperf3","Starts a throughput test as an `iperf3` client, connecting to `server_ip` and running the test for 30 seconds (`-t 30`). Displays the average bandwidth achieved during the period.","iperf3 -c server_ip -t 30","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">iperf3\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -c server_ip -t 30\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":580,"title":581,"description":582,"code":583,"language":44,"filename":9,"whenToUse":9,"highlighted":584},"d525e871-bf00-47e7-91c6-295c5e1b53f0","Latency Test with Ping (Summary)","Performs 100 pings with a 0.1-second interval to `server_ip` and displays only the last line of output, which contains the latency statistics summary (min\u002Favg\u002Fmax\u002Fmdev). Useful for quick latency tests.","ping -c 100 -i 0.1 server_ip | tail -1","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">ping\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -c 100 -i 0.1 server_ip | tail -1\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",{"id":586,"title":587,"description":588,"code":589,"language":44,"filename":9,"whenToUse":9,"highlighted":590},"2e0bc05e-882f-4d52-b001-535f3a5878ea","Testar Porta Aberta com Netcat","Testa se uma porta específica (neste caso, 80) está aberta e acessível em um `server_ip`. A flag `-z` faz um scan sem enviar dados, e `-v` fornece saída verbosa, indicando sucesso ou falha na conexão.","netcat -z -v server_ip 80","\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">netcat\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> -z -v server_ip 80\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",83]