We provide a complete, unattended installation of OpenGFW v0.4.1 with the following features:
- π€ Unattended Installation: Fully automated with comprehensive error handling
- π οΈ Robust Error Handling: Includes retry mechanisms and cleanup procedures
- π Logging: Colored output with timestamps for better visibility
- β System Validation: Checks system requirements before installation
- βοΈ Service Management: Automatically configures and starts systemd service
- π§ Operating System: Linux with systemd support (Ubuntu, Debian, CentOS, etc.)
- π§ Architecture:
x86_64
(amd64) - π Privileges: Root or sudo access
- π Network: Internet connection to download components from GitHub
-
π₯ Download the installation script:
wget https://raw.githubusercontent.com/liuzhen9320/OpenGFW-configuration/main/scripts/install.sh chmod +x install.sh
-
π― Run the installation:
sudo ./install.sh
-
π Verify installation:
systemctl status opengfw.service
The script performs the following actions:
- π System Updates: Updates package lists and installs required dependencies
- π Directory Creation: Creates
/opt/opengfw
for installation files - β¬οΈ Binary Download: Downloads OpenGFW v0.4.0 binary for Linux AMD64
- π Configuration Files: Downloads default configuration and rules files
- π§ Service Setup: Installs and configures systemd service
βΆοΈ Service Start: Enables and starts the OpenGFW service
After installation, you'll find the following files:
/opt/opengfw/
βββ OpenGFW # π Main executable binary
βββ config.yml # βοΈ Main configuration file
βββ rules.yml # π Filtering rules configuration
/usr/lib/systemd/system/
βββ opengfw.service # π§ Systemd service file
After installation, you can modify the configuration files:
- βοΈ Main configuration: Edit
/opt/opengfw/config.yml
- π Filter rules: Edit
/opt/opengfw/rules.yml
- π Restart service:
sudo systemctl restart opengfw.service
# π Check service status
systemctl status opengfw.service
# βΆοΈ Start the service
sudo systemctl start opengfw.service
# βΉοΈ Stop the service
sudo systemctl stop opengfw.service
# π Restart the service
sudo systemctl restart opengfw.service
# π Enable auto-start on boot
sudo systemctl enable opengfw.service
# π« Disable auto-start on boot
sudo systemctl disable opengfw.service
# π View service logs
journalctl -u opengfw.service -f
Monitor OpenGFW logs in real-time:
journalctl -u opengfw.service -f
View recent logs:
journalctl -u opengfw.service --since "1 hour ago"
-
π« Permission Denied:
- Ensure you're running the script with sudo or as root
- Check file permissions:
chmod +x install.sh
-
π Download Failures:
- Verify internet connectivity
- Check if GitHub is accessible from your server
- Retry the installation (script has built-in retry mechanisms)
-
β οΈ Service Start Issues:- Check service status:
systemctl status opengfw.service
- Review logs:
journalctl -u opengfw.service
- Verify configuration files are valid
- Check service status:
-
π Check System Requirements:
# Verify architecture uname -m # Check systemd systemctl --version
-
π Manual Service Restart:
sudo systemctl daemon-reload sudo systemctl restart opengfw.service
To remove OpenGFW:
# βΉοΈ Stop and disable service
sudo systemctl stop opengfw.service
sudo systemctl disable opengfw.service
# ποΈ Remove service file
sudo rm /usr/lib/systemd/system/opengfw.service
# π Remove installation directory
sudo rm -rf /opt/opengfw
# π Reload systemd
sudo systemctl daemon-reload
- π‘οΈ OpenGFW is a network analysis tool that can inspect and filter network traffic
- π₯ Ensure proper firewall configuration and access controls
- π Review and customize filtering rules according to your security requirements
- π Monitor service logs for security events
- π΄ Fork the repository
- πΏ Create a feature branch
- β¨ Make your changes
- π§ͺ Test thoroughly
- π€ Submit a pull request
This installation script is provided as-is. Please refer to the original OpenGFW project for licensing information.
For issues related to:
- π οΈ Installation Script: Create an issue in this repository
- π§ OpenGFW Core: Visit OpenGFW GitHub
- βοΈ Configuration: Check OpenGFW Configuration