Reduced MTU to hopefully improve upload speeds
This commit is contained in:
parent
98576f5b27
commit
c0c9daf45d
@ -11,6 +11,7 @@ import ipaddress
|
||||
from typing import TypeVar, Generic
|
||||
from io import TextIOBase
|
||||
from pathlib import Path
|
||||
import math
|
||||
|
||||
|
||||
class Reason(enum.StrEnum):
|
||||
@ -64,6 +65,16 @@ class Config:
|
||||
self._route_id += 1
|
||||
return val
|
||||
|
||||
@property
|
||||
def num_digits_inclusions(self) -> int:
|
||||
"""Number of digits to use for inclusion route IDs."""
|
||||
return max(2, int(math.log10(len(self.split_tunnel_inclusions))) + 1)
|
||||
|
||||
@property
|
||||
def num_digits_exclusions(self) -> int:
|
||||
"""Number of digits to use for exclusion route IDs."""
|
||||
return max(2, int(math.log10(len(self.split_tunnel_exclusions))) + 1)
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.vpnd_connection_name = os.environ.get("VPND_CONNECTION_NAME")
|
||||
@ -178,11 +189,13 @@ class Config:
|
||||
"[Match]\n",
|
||||
f"Name={self.tun_device}\n",
|
||||
"Kind=tun\n",
|
||||
"[Network]\n",
|
||||
"\n[Link]\n",
|
||||
"MTUBytes=1422\n",
|
||||
"\n[Network]\n",
|
||||
f"Address={self.internal_ipv4_address}\n",
|
||||
f"DNS={' '.join(str(dns) for dns in self.internal_ipv4_dns)}\n",
|
||||
f"Domains={self.default_domain} {' '.join(str(domain) for domain in self.search_domains)}\n",
|
||||
"[Route]\n",
|
||||
"\n[Route]\n",
|
||||
"Gateway=0.0.0.0\n",
|
||||
"Metric=64\n",
|
||||
f"Table={self.split_enforcement_table if self.vpnd_enforce_split_tunnel else 'main'}\n",
|
||||
@ -210,6 +223,7 @@ class Config:
|
||||
dir.mkdir()
|
||||
for net in self.split_tunnel_inclusions:
|
||||
self.write_route(dir, net)
|
||||
self._route_id = 0
|
||||
if self.vpnd_enforce_split_tunnel:
|
||||
# configure exclusions after inclusions. inclusions don't make sense without this, since they'd just be captured by the default.
|
||||
for net in self.split_tunnel_exclusions:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user