Advanced Traffic Control Configuration for Xanmod Kernel
This script optimizes your network traffic using sophisticated techniques to enhance performance and control.
- Xanmod Kernel Detection: The script automatically verifies the presence of the Xanmod kernel, a performance-oriented kernel optimized for high-throughput and low-latency operations. This ensures that your system is primed for the advanced features the script is designed to implement.
- System Update & Package Installation: Ensures that your system is up-to-date by performing a comprehensive update and installing critical networking tools. These components form the backbone of the script’s traffic control and QoS management capabilities.
- Advanced QoS Configuration: Leverages
tc
(traffic control) withHTB
(Hierarchical Token Bucket) to establish a sophisticated QoS system. This configuration enables precise control over traffic flow, ensuring efficient bandwidth distribution and prioritization of critical network traffic. - Multi-layer Traffic Shaping: Implements state-of-the-art traffic shaping techniques, incorporating cutting-edge algorithms such as
CAKE
,FQ_Codel
, andFQ_PIE
. These algorithms dynamically manage traffic queues to minimize latency and bufferbloat, delivering an optimized network experience. - Adaptive Queue Management: Utilizes adaptive queue management strategies that respond in real-time to network conditions, adjusting traffic flow to maintain optimal performance. This includes fine-tuning of queue disciplines to balance fairness and efficiency.
- Intelligent Packet Manipulation: Applies advanced
iptables
rules for sophisticated packet filtering, redirection, and modification, enhancing both security and performance. The script intelligently adjusts TCP MSS values and applies custom ToS flags to optimize data flow. - Detailed Logging: Captures detailed logs of all operations for thorough auditing and troubleshooting, ensuring transparency and traceability in the script’s execution.
- Xanmod Kernel: This script is designed to work with the Xanmod kernel. Make sure it's installed and running.
- Required Packages:
iproute2
,iptable
To run this script directly using wget or curl, follow the instructions below:
bash <(curl -s https://raw.githubusercontent.com/FReak4L/Tc-Config/main/tc.sh) -s
bash <(wget -qO- https://raw.githubusercontent.com/FReak4L/Tc-Config/main/tc.sh) -s
To execute the script, simply run:
bash tc.sh -s
This will start the script and you'll be prompted to select your network interface and specify your uplink and downlink bandwidth. You can use the defaults or input your own values.
bash tc.sh -h
Delete All TC configuration :
bash tc.sh -d
Here's what the script does, step-by-step:
-
Kernel Check:
The script begins by ensuring the Xanmod kernel is active. This kernel is tailored for high-performance networking and system responsiveness, making it a critical component for the script's advanced traffic management features. If the correct kernel is not detected, the script provides immediate feedback, allowing you to take corrective action.
-
System Update & Package Installation:
Next, the script performs a comprehensive system update, ensuring all software is current. It then installs essential networking packages such as
iproute2
andiptables
. These tools are fundamental for the script's operation, providing the necessary functionality for traffic control and quality of service management. -
QoS Setup:
The script then sets up
tc
withHTB
, creating a multi-tiered traffic control structure. This setup allows for hierarchical bandwidth allocation, ensuring that critical traffic is prioritized while maintaining overall network efficiency. The use of HTB ensures that bandwidth is distributed according to predefined rules, optimizing network performance under varying loads. -
Traffic Shaping:
To further enhance network performance, the script implements advanced traffic shaping techniques using algorithms like
FQ_Codel
,FQ_PIE
, andCAKE
. These algorithms are designed to intelligently manage queue lengths and reduce network latency. By minimizing bufferbloat, they ensure a more responsive internet experience, particularly under conditions of heavy network usage. -
Advanced Traffic Optimization:
The script then configures a complex queue discipline structure, tailoring it to various types of traffic such as video streaming, gaming, or bulk downloads. This customization allows each type of traffic to be handled according to its specific needs, optimizing both performance and user experience. The script's use of advanced algorithms like
CAKE
andFQ_PIE
enables it to adapt dynamically to changing network conditions, ensuring consistent performance. - Interface:
eth0
(default),ens3
, or custom. - Uplink:
5gbit
(default),1gbit
, or custom. - Downlink:
5gbit
(default),1gbit
, or custom.
The script provides a user-friendly menu where you can select your network interface and set your desired uplink and downlink speeds:
All actions performed by the script are logged to /var/log/tc-freak.log
. This log can be very useful for troubleshooting or simply reviewing the changes made by the script.
This project is licensed under the GNU General Public License v3.0.
Note: Use this script at your own risk. It is provided "as is" without any warranty.