Skip to main content

No project description provided

Project description

sqredirect

Redirection and filtering Source Engine game traffic in a bundle with sqproxy

How it Works?

sqredirect attach eBPF filter(s) to network interface and manipulate with traffic targeting to game ports

eBPF is more efficient way to check/accept/drop packets in Linux

More in Wikipedia

Requirements

  • Linux
  • Kernel version >= 4.4, check your by command: uname -r
  • python2 or python3

Installation

TODO: Split into Ubuntu/Debian/Others like in bcc-tools README

Step 1: Install bcc-tools

Step 2: Install sqredirect

python -m pip install sqredirect

https://pypi.org/project/sqredirect/

Usage

Automatically

Only by SQProxy

Non-root running

bcc-tools can't be used w/o root, see https://github.com/iovisor/bcc/issues/1166

But you can use this snippet to restrict usage only to specified user/group:

TL;DR: move python redirect.py $@ to command and add permissions in /etc/sudoers


  1. Copy content of this folder to /usr/src/sqredirect

  2. Create file in /usr/local/bin/sqredirect with content:

    #!/bin/bash
    
    cd /usr/src/sqredirect
    exec python2 /usr/src/sqredirect/redirect.py $@
    
  3. chmod +x /usr/local/bin/sqredirect

  4. Create group network and add user to group

    addgroup network
    usermod -aG network <user-which-should-it-run>
    
  5. Allow run sqredirect command w/o root privileges

    echo "%network ALL=(root) NOPASSWD: /usr/local/bin/sqredirect" > /etc/sudoers.d/network
    

More about sudoers: https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file

Troubleshooting

Problem: I can't reach my server through network

Solution: Rollback any changes at network level, run in console (if you have access):

tc qdisc del dev eth0 root

replace eth0 with your interface name

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqredirect-1.2.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

sqredirect-1.2.0-py2.py3-none-any.whl (19.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sqredirect-1.2.0.tar.gz.

File metadata

  • Download URL: sqredirect-1.2.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.8 Darwin/20.3.0

File hashes

Hashes for sqredirect-1.2.0.tar.gz
Algorithm Hash digest
SHA256 50b68fc0c5c01cbadb2c52dc03084ae229ed60d4ba7ef236ee256e34c807131e
MD5 bae2823e8eb227f6146eaa317b2a7311
BLAKE2b-256 96869c7e16c189e382bd2d092a82c877e240e76a47fb0efa11053038ccf5b1d5

See more details on using hashes here.

File details

Details for the file sqredirect-1.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: sqredirect-1.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.8 Darwin/20.3.0

File hashes

Hashes for sqredirect-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0345cb0c82108f14a9dbdb35ca2df67d6f80d084c9cea885ea58e0ab99137a22
MD5 feeafc9f52f30a43e591a74f52ed8e6a
BLAKE2b-256 adcabd7c04437f09180f09eccff70167e0df855a4d1f574585adb2807c1ddfad

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page