mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
dhcp fix
This commit is contained in:
@@ -436,7 +436,7 @@ def _get_config_scheme() -> Dict:
|
|||||||
|
|
||||||
"firewall": {
|
"firewall": {
|
||||||
"allow_tcp": Option([], type=valid_ports_list),
|
"allow_tcp": Option([], type=valid_ports_list),
|
||||||
"allow_udp": Option([], type=valid_ports_list),
|
"allow_udp": Option([67], type=valid_ports_list),
|
||||||
"iptables_cmd": Option(["/usr/bin/iptables"], type=valid_command),
|
"iptables_cmd": Option(["/usr/bin/iptables"], type=valid_command),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ class _Service: # pylint: disable=too-many-instance-attributes
|
|||||||
ctls: List[BaseCtl] = [
|
ctls: List[BaseCtl] = [
|
||||||
CustomCtl(self.__pre_start_cmd, self.__post_stop_cmd, placeholders),
|
CustomCtl(self.__pre_start_cmd, self.__post_stop_cmd, placeholders),
|
||||||
IfaceUpCtl(self.__ip_cmd, netcfg.iface),
|
IfaceUpCtl(self.__ip_cmd, netcfg.iface),
|
||||||
IptablesDropAllCtl(self.__iptables_cmd, netcfg.iface),
|
|
||||||
*[
|
*[
|
||||||
IptablesAllowPortCtl(self.__iptables_cmd, netcfg.iface, port, tcp)
|
IptablesAllowPortCtl(self.__iptables_cmd, netcfg.iface, port, tcp)
|
||||||
for (port, tcp) in [
|
for (port, tcp) in [
|
||||||
@@ -99,6 +98,7 @@ class _Service: # pylint: disable=too-many-instance-attributes
|
|||||||
*zip(self.__allow_udp, itertools.repeat(False)),
|
*zip(self.__allow_udp, itertools.repeat(False)),
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
IptablesDropAllCtl(self.__iptables_cmd, netcfg.iface),
|
||||||
IfaceAddIpCtl(self.__ip_cmd, netcfg.iface, f"{netcfg.iface_ip}/{netcfg.net_prefix}"),
|
IfaceAddIpCtl(self.__ip_cmd, netcfg.iface, f"{netcfg.iface_ip}/{netcfg.net_prefix}"),
|
||||||
CustomCtl(self.__post_start_cmd, self.__pre_stop_cmd, placeholders),
|
CustomCtl(self.__post_start_cmd, self.__pre_stop_cmd, placeholders),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user