diff --git a/fuelmenu/modules/cobblerconf.py b/fuelmenu/modules/cobblerconf.py index 7a72a3c..a0c986f 100644 --- a/fuelmenu/modules/cobblerconf.py +++ b/fuelmenu/modules/cobblerconf.py @@ -400,8 +400,14 @@ interface first.") elif key == "ADMIN_NETWORK/dhcp_pool_end": self.edits[index].set_edit_text(dynamic_end) elif key == "ADMIN_NETWORK/dhcp_gateway": - self.edits[index].set_edit_text(self.netsettings[ - self.activeiface]['addr']) + gw = self.get_default_gateway_linux() + if network.inSameSubnet( + gw, dynamic_start, + self.netsettings[self.activeiface]['netmask']): + dhcp_gateway = gw + else: + dhcp_gateway = self.netsettings[self.activeiface]['addr'] + self.edits[index].set_edit_text(dhcp_gateway) def refresh(self): self.getNetwork()