From a3ca9d2cf7fcd8cd57f8eea4219f6b8c346793b3 Mon Sep 17 00:00:00 2001 From: rustcult <161612979+rustcult@users.noreply.github.com> Date: Thu, 23 May 2024 20:51:43 +0800 Subject: [PATCH 1/3] Add Gaming Oriented Routing Tutorial --- .../configuration/gaming-oriented-routing.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 docs/en/configuration/gaming-oriented-routing.md diff --git a/docs/en/configuration/gaming-oriented-routing.md b/docs/en/configuration/gaming-oriented-routing.md new file mode 100644 index 000000000..8c72d83d8 --- /dev/null +++ b/docs/en/configuration/gaming-oriented-routing.md @@ -0,0 +1,72 @@ +DAE Config (e.g. /etc/dae/config.dae) + +``` +routing { +#stop using low efficiency socks5 proxy or else +#dscp(8) -> game + +#using fw mark for ultra fast gaming experience +dscp(8) -> direct(mark:0x800) +} + +``` + +OpenWRT Network Config (e.g. /etc/config/network) + +Please choose the tunnel MTU carefully (CS2 Require MTU > 1300 due to UDP Ping (1300 bytes)) + +``` +config interface 'wg100' + option proto 'wireguard' + option private_key '[Client Private Key]' + list addresses '10.7.0.2/24' + list addresses 'fd42:42:42::2/64' + option mtu '1420' + +config wireguard_wg100 + option public_key '[Server Public Key]' + option endpoint_host '[Your Server IP]' + list allowed_ips '0.0.0.0/0' + list allowed_ips '::/0' + +config route + option interface 'wg100' + option target '0.0.0.0/0' + option gateway '10.7.0.1' + option table '114' + +config route6 + option interface 'wg100' + option target '::/0' + option gateway 'fd42:42:42::1' + option table '114' + +config rule + option lookup '114' + option mark '0x800/0x800' + +config rule6 + option lookup '114' + option mark '0x800/0x800' +``` + +OpenWRT Firewall Config (e.g. /etc/config/firewall) + +``` +config nat + option src 'vpn' + option src_ip '[Gaming PC IPv4 Address]' + option target 'SNAT' + option snat_ip '10.7.0.2' + option family 'ipv4' + list proto 'all' + +config nat + option src 'vpn' + option src_ip '[Gaming PC IPv6 Address]' + option target 'SNAT' + option snat_ip 'fd42:42:42::2' + option family 'ipv6' + list proto 'all' + +``` \ No newline at end of file From 8e41b1af47d9bda420644c0635aec1331f5eb37a Mon Sep 17 00:00:00 2001 From: rustcult <161612979+rustcult@users.noreply.github.com> Date: Sun, 16 Jun 2024 14:23:56 +0000 Subject: [PATCH 2/3] Correct grammatical and formatting errors --- .../configuration/gaming-oriented-routing.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/en/configuration/gaming-oriented-routing.md b/docs/en/configuration/gaming-oriented-routing.md index 8c72d83d8..608bba704 100644 --- a/docs/en/configuration/gaming-oriented-routing.md +++ b/docs/en/configuration/gaming-oriented-routing.md @@ -1,17 +1,21 @@ -DAE Config (e.g. /etc/dae/config.dae) +# Routing designed specifically for gaming +## Examples + +### DAE Config (e.g. /etc/dae/config.dae) ``` routing { -#stop using low efficiency socks5 proxy or else -#dscp(8) -> game +# Stop using low efficiency socks5 proxy ... +# dscp(8) -> game -#using fw mark for ultra fast gaming experience +### Use fw mark for ultra fast gaming experience dscp(8) -> direct(mark:0x800) } ``` -OpenWRT Network Config (e.g. /etc/config/network) +### OpenWRT Network Config (e.g. /etc/config/network) +This article uses the WireGuard tunnel in OpenWRT as an example; other tunnel configuration files can refer to the WireGuard tunnel. Please choose the tunnel MTU carefully (CS2 Require MTU > 1300 due to UDP Ping (1300 bytes)) @@ -50,7 +54,7 @@ config rule6 option mark '0x800/0x800' ``` -OpenWRT Firewall Config (e.g. /etc/config/firewall) +### OpenWRT Firewall Config (e.g. /etc/config/firewall) ``` config nat @@ -63,7 +67,7 @@ config nat config nat option src 'vpn' - option src_ip '[Gaming PC IPv6 Address]' + option src_ip '[Gaming PC IPv6 Address]' option target 'SNAT' option snat_ip 'fd42:42:42::2' option family 'ipv6' From df4c5830c16d2156af3fc8c8886ff4f446cd3385 Mon Sep 17 00:00:00 2001 From: rustcult <161612979+rustcult@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:28:58 +0000 Subject: [PATCH 3/3] more details --- .../configuration/gaming-oriented-routing.md | 132 ++++++++++-------- 1 file changed, 72 insertions(+), 60 deletions(-) diff --git a/docs/en/configuration/gaming-oriented-routing.md b/docs/en/configuration/gaming-oriented-routing.md index 608bba704..2e222f643 100644 --- a/docs/en/configuration/gaming-oriented-routing.md +++ b/docs/en/configuration/gaming-oriented-routing.md @@ -1,76 +1,88 @@ -# Routing designed specifically for gaming -## Examples +# Routing Configuration for Gaming -### DAE Config (e.g. /etc/dae/config.dae) +DSCP allows network devices to prioritize tagged packets, ensuring that gaming traffic isn’t delayed by other data on the network. For gaming, where low latency and stable connections are critical, combine DSCP and VPN can help minimize these issues. + +By using DSCP tagging and VPN tunnels for gaming traffic, this setup can achieve the following: + +- Prioritize gaming traffic to reduce latency and jitter. +- Ensure secure data transmission, bypassing ISP throttling and traffic management. +- Adapt to various VPN protocols, making it versatile for different network environments. + +### DAE Configuration (e.g., /etc/dae/config.dae) +This setup optimizes routing specifically for gaming, aiming to minimize latency and enhance speed by avoiding proxies and leveraging direct routes with fwmark. The configuration is designed to prioritize gaming traffic efficiently. ``` routing { -# Stop using low efficiency socks5 proxy ... -# dscp(8) -> game - -### Use fw mark for ultra fast gaming experience -dscp(8) -> direct(mark:0x800) + # Direct all gaming traffic for low latency + # Set DSCP mark for prioritized gaming traffic + dscp(8) -> direct(mark:0x800) } ``` ### OpenWRT Network Config (e.g. /etc/config/network) -This article uses the WireGuard tunnel in OpenWRT as an example; other tunnel configuration files can refer to the WireGuard tunnel. - -Please choose the tunnel MTU carefully (CS2 Require MTU > 1300 due to UDP Ping (1300 bytes)) +This example configures a WireGuard tunnel in OpenWRT to provide an optimized route for gaming traffic. Select the appropriate MTU value based on game requirements (e.g., CS2 requires MTU > 1300 for proper UDP Ping functionality). ``` -config interface 'wg100' - option proto 'wireguard' - option private_key '[Client Private Key]' - list addresses '10.7.0.2/24' - list addresses 'fd42:42:42::2/64' - option mtu '1420' - -config wireguard_wg100 - option public_key '[Server Public Key]' - option endpoint_host '[Your Server IP]' - list allowed_ips '0.0.0.0/0' - list allowed_ips '::/0' - -config route - option interface 'wg100' - option target '0.0.0.0/0' - option gateway '10.7.0.1' - option table '114' - -config route6 - option interface 'wg100' - option target '::/0' - option gateway 'fd42:42:42::1' - option table '114' - -config rule - option lookup '114' - option mark '0x800/0x800' - -config rule6 - option lookup '114' - option mark '0x800/0x800' +config interface 'wg100' + option proto 'wireguard' + option private_key '[Client Private Key]' + list addresses '10.7.0.2/24' + list addresses 'fd42:42:42::2/64' + option mtu '1420' + +config wireguard_wg100 + option public_key '[Server Public Key]' + option endpoint_host '[Your Server IP]' + list allowed_ips '0.0.0.0/0' + list allowed_ips '::/0' + +# IPv4 Route for gaming traffic +config route + option interface 'wg100' + option target '0.0.0.0/0' + option gateway '10.7.0.1' + option table '114' + +# IPv6 Route for gaming traffic +config route6 + option interface 'wg100' + option target '::/0' + option gateway 'fd42:42:42::1' + option table '114' + +# IPv4 Rule for gaming traffic using fwmark +config rule + option lookup '114' + option mark '0x800/0x800' + +# IPv6 Rule for gaming traffic using fwmark +config rule6 + option lookup '114' + option mark '0x800/0x800' ``` ### OpenWRT Firewall Config (e.g. /etc/config/firewall) +This firewall configuration ensures that gaming traffic from a specific device (e.g., Gaming PC) is correctly translated within the VPN environment, both for IPv4 and IPv6. + +``` +# IPv4 NAT for gaming traffic +config nat + option src 'vpn' + option src_ip '[Gaming PC IPv4 Address]' + option target 'SNAT' + option snat_ip '10.7.0.2' + option family 'ipv4' + list proto 'all' + +# IPv6 NAT for gaming traffic +config nat + option src 'vpn' + option src_ip '[Gaming PC IPv6 Address]' + option target 'SNAT' + option snat_ip 'fd42:42:42::2' + option family 'ipv6' + list proto 'all' ``` -config nat - option src 'vpn' - option src_ip '[Gaming PC IPv4 Address]' - option target 'SNAT' - option snat_ip '10.7.0.2' - option family 'ipv4' - list proto 'all' - -config nat - option src 'vpn' - option src_ip '[Gaming PC IPv6 Address]' - option target 'SNAT' - option snat_ip 'fd42:42:42::2' - option family 'ipv6' - list proto 'all' - -``` \ No newline at end of file +This configuration establishes low-latency, efficient routing for gaming traffic via a WireGuard tunnel, using fwmark to avoid proxy delays and enable direct connections for enhanced performance. \ No newline at end of file