summaryrefslogtreecommitdiff
path: root/kvmd/apps/otgnet/netctl.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/apps/otgnet/netctl.py')
-rw-r--r--kvmd/apps/otgnet/netctl.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/kvmd/apps/otgnet/netctl.py b/kvmd/apps/otgnet/netctl.py
index 15b5ea8c..4c3f2b69 100644
--- a/kvmd/apps/otgnet/netctl.py
+++ b/kvmd/apps/otgnet/netctl.py
@@ -45,6 +45,19 @@ class IfaceAddIpCtl(BaseCtl):
return [*self.__base_cmd, "address", ("add" if direct else "del"), self.__cidr, "dev", self.__iface]
+class IptablesAllowEstRelCtl(BaseCtl):
+ def __init__(self, base_cmd: list[str], iface: str) -> None:
+ self.__base_cmd = base_cmd
+ self.__iface = iface
+
+ def get_command(self, direct: bool) -> list[str]:
+ return [
+ *self.__base_cmd,
+ ("-A" if direct else "-D"), "INPUT", "-i", self.__iface,
+ "-m", "state", "--state", "ESTABLISHED,RELATED", "-j", "ACCEPT",
+ ]
+
+
class IptablesDropAllCtl(BaseCtl):
def __init__(self, base_cmd: list[str], iface: str) -> None:
self.__base_cmd = base_cmd