Skip to content

liuzhen9320/OpenGFW-configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ OpenGFW Configuration

✨ Overview

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

πŸ“‹ Prerequisites

  • 🐧 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

πŸš€ Quick Start

  1. πŸ“₯ Download the installation script:

    wget https://raw.githubusercontent.com/liuzhen9320/OpenGFW-configuration/main/scripts/install.sh
    chmod +x install.sh
  2. 🎯 Run the installation:

    sudo ./install.sh
  3. πŸ” Verify installation:

    systemctl status opengfw.service

πŸ“¦ What Gets Installed

The script performs the following actions:

  1. πŸ”„ System Updates: Updates package lists and installs required dependencies
  2. πŸ“‚ Directory Creation: Creates /opt/opengfw for installation files
  3. ⬇️ Binary Download: Downloads OpenGFW v0.4.0 binary for Linux AMD64
  4. πŸ“ Configuration Files: Downloads default configuration and rules files
  5. πŸ”§ Service Setup: Installs and configures systemd service
  6. ▢️ Service Start: Enables and starts the OpenGFW service

πŸ“ File Locations

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

πŸ”§ Configuration

🎨 Customizing Configuration

After installation, you can modify the configuration files:

  1. βš™οΈ Main configuration: Edit /opt/opengfw/config.yml
  2. πŸ” Filter rules: Edit /opt/opengfw/rules.yml
  3. πŸ”„ Restart service: sudo systemctl restart opengfw.service

πŸŽ›οΈ Service Management

πŸ”§ Common Commands

# πŸ” 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

πŸ“Š Service Logs

Monitor OpenGFW logs in real-time:

journalctl -u opengfw.service -f

View recent logs:

journalctl -u opengfw.service --since "1 hour ago"

πŸ”§ Troubleshooting

🚨 Installation Issues

  1. 🚫 Permission Denied:

    • Ensure you're running the script with sudo or as root
    • Check file permissions: chmod +x install.sh
  2. πŸ’” Download Failures:

    • Verify internet connectivity
    • Check if GitHub is accessible from your server
    • Retry the installation (script has built-in retry mechanisms)
  3. ⚠️ Service Start Issues:

    • Check service status: systemctl status opengfw.service
    • Review logs: journalctl -u opengfw.service
    • Verify configuration files are valid

πŸ’‘ Common Solutions

  1. πŸ” Check System Requirements:

    # Verify architecture
    uname -m
    
    # Check systemd
    systemctl --version
  2. πŸ”„ Manual Service Restart:

    sudo systemctl daemon-reload
    sudo systemctl restart opengfw.service

πŸ—‘οΈ Uninstallation

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

πŸ”’ Security Considerations

  • πŸ›‘οΈ 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

🀝 Contributing

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch
  3. ✨ Make your changes
  4. πŸ§ͺ Test thoroughly
  5. πŸ“€ Submit a pull request

πŸ“„ License

This installation script is provided as-is. Please refer to the original OpenGFW project for licensing information.

πŸ’¬ Support

For issues related to:


⚠️ Note: This tool is for educational and legitimate network analysis purposes only. Please ensure compliance with local laws and regulations. πŸ›οΈ

About

Our rules to block some connection. πŸ”

Topics

Resources

License

Stars

Watchers

Forks

Languages