How to Block Internet Access for Any Linux App (While Keeping LAN)

📰 Dev.to · Khadirullah Mohammad

Learn to block internet access for Linux apps while keeping LAN access, useful for security and privacy

intermediate Published 8 Apr 2026
Action Steps
  1. Install the iptables package using apt-get or yum
  2. Create a new iptables rule to block outgoing internet traffic for a specific app
  3. Use the --jump option to specify the action for the rule
  4. Apply the rule to the app using the -p option
  5. Test the rule to ensure internet access is blocked while LAN access remains
Who Needs to Know This

This technique benefits developers and system administrators who need to control network access for specific applications, enhancing security and privacy

Key Insight

💡 Use iptables to control network access for specific Linux applications

Share This
🚫 Block internet access for Linux apps while keeping LAN access 📊

Key Takeaways

Learn to block internet access for Linux apps while keeping LAN access, useful for security and privacy

Full Article

Ever wanted Jellyfin to stay off the internet? Or Chromium to only work on your local network? Maybe...
Read full article → ← Back to Reads