mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
pikvm/pikvm#957: Added ESTABLISHED,RELATED rule to otgnet
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user