ํ™”. 8์›” 12th, 2025

D: So you’ve installed OpenWrt on your routerโ€”congrats! ๐ŸŽ‰ But before you celebrate, there’s one crucial step left: securing your OpenWrt setup. Without proper security configurations, your network could be vulnerable to attacks.

In this guide, we’ll walk you through essential OpenWrt security settings that you must configure to protect your network from hackers, malware, and unauthorized access. Letโ€™s dive in! ๐Ÿš€


1. Change the Default Password ๐Ÿ›ก๏ธ

The first and most critical step is changing the default password (admin or blank).

โœ… How to do it:

  1. Log in to OpenWrtโ€™s LuCI web interface (usually http://192.168.1.1).
  2. Go to System โ†’ Administration.
  3. Set a strong password (use a mix of uppercase, lowercase, numbers, and symbols).

๐Ÿšจ Why? Default passwords are publicly known, making your router an easy target.


2. Enable HTTPS for Secure Web Access ๐Ÿ”

By default, OpenWrt uses HTTP, which is not encrypted. Switching to HTTPS prevents eavesdropping.

โœ… How to do it:

  1. Install the luci-ssl package:
    opkg update && opkg install luci-ssl
  2. Restart the web interface:
    /etc/init.d/uhttpd restart
  3. Now access your router via https://192.168.1.1 (ignore the self-signed certificate warning for now).

๐Ÿ”น Bonus: Install a real SSL certificate (Letโ€™s Encrypt) for full security.


3. Disable Unnecessary Services ๏ฟฝ

OpenWrt runs several services by defaultโ€”some may not be needed and could pose security risks.

โœ… What to disable:

  • Telnet (use SSH instead)
  • HTTP (if you enabled HTTPS)
  • IPv6 (if not in use)

โœ… How to disable:

  1. Go to System โ†’ Startup.
  2. Disable unwanted services (/etc/init.d/ disable).

โš ๏ธ Warning: Only disable services youโ€™re sure you donโ€™t need!


4. Set Up a Firewall & Block Unwanted Traffic ๐Ÿงฑ

OpenWrt includes a powerful firewall (fw3) to control incoming/outgoing traffic.

โœ… Essential firewall rules:

  • Block WAN access to LuCI (prevent external attacks):
    uci set firewall.@rule[-1].dest_port='80,443'
    uci set firewall.@rule[-1].proto='tcp'
    uci set firewall.@rule[-1].target='REJECT'
    uci commit
    /etc/init.d/firewall restart
  • Enable SYN flood protection (DDoS mitigation):
    uci set firewall.@defaults[0].syn_flood=1
    uci commit

5. Keep OpenWrt Updated โšก

Outdated firmware = security vulnerabilities. Always update!

โœ… How to update:

  1. Check for updates:
    opkg update && opkg list-upgradable
  2. Upgrade packages:
    opkg upgrade 
  3. For major releases, flash a new firmware image (backup config first!).

๐Ÿ”น Pro Tip: Enable automatic security updates (if available).


6. Use SSH Key Authentication (No Passwords!) ๐Ÿ”‘

Password-based SSH logins can be brute-forced. Switch to SSH keys for better security.

โœ… How to set up:

  1. Generate an SSH key on your PC:
    ssh-keygen -t ed25519
  2. Copy the public key to OpenWrt:
    ssh-copy-id root@192.168.1.1
  3. Disable password login in /etc/ssh/sshd_config:
    PasswordAuthentication no

7. Enable Fail2Ban to Block Brute Force Attacks ๐Ÿšจ

Fail2Ban automatically blocks IPs after repeated failed login attempts.

โœ… How to install & configure:

  1. Install Fail2Ban:
    opkg install fail2ban
  2. Configure it to monitor SSH/LuCI logs:
    nano /etc/fail2ban/jail.local

    Add:

    [sshd]
    enabled = true
  3. Start & enable Fail2Ban:
    /etc/init.d/fail2ban start && /etc/init.d/fail2ban enable

8. Disable ICMP Ping Probes (Prevent Network Scanning) ๐Ÿ•ต๏ธ

Hackers often use ping scans to detect live routers.

โœ… How to block ICMP pings:

uci set firewall.@rule[-1].proto='icmp'
uci set firewall.@rule[-1].target='REJECT'
uci commit
/etc/init.d/firewall restart

Final Thoughts: Stay Safe! ๐Ÿ›ก๏ธ

OpenWrt is powerful but requires proper security hardening. By following these steps, youโ€™ll significantly reduce risks and keep your network safe.

๐Ÿ”น Extra Security Tips:

  • Use VPN for remote access instead of exposing services.
  • Regularly check logs (logread) for suspicious activity.
  • Consider MAC address filtering for extra device control.

๐Ÿš€ Now your OpenWrt is locked downโ€”happy (and safe) networking! ๐ŸŽฏ

Did we miss anything? Let us know in the comments! ๐Ÿ’ฌ๐Ÿ‘‡

๋‹ต๊ธ€ ๋‚จ๊ธฐ๊ธฐ

์ด๋ฉ”์ผ ์ฃผ์†Œ๋Š” ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ํ•„๋“œ๋Š” *๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค