otgnet: apply net.ipv4.ip_forward=1 on forwarding

This commit is contained in:
Maxim Devaev
2025-06-03 21:01:58 +03:00
parent 91312dd4be
commit 0d8b7fd3aa
4 changed files with 17 additions and 1 deletions

View File

@@ -121,6 +121,16 @@ class IptablesForwardIn(BaseCtl):
]
class SysctlIpv4ForwardCtl(BaseCtl):
def __init__(self, base_cmd: list[str]) -> None:
self.__base_cmd = base_cmd
def get_command(self, direct: bool) -> list[str]:
if direct:
return [*self.__base_cmd, "net.ipv4.ip_forward=1"]
return [] # Don't revert the command because some services can require it too
class CustomCtl(BaseCtl):
def __init__(
self,