From 731696b47493561d73e385d673cbe9c40a62c275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ko=C5=A1=C5=A5=C3=A1l?= Date: Thu, 3 Mar 2016 09:04:26 +0100 Subject: [PATCH] Added support for fixed DHCP IPs when using vlan over bond. In my server config I use em1+em2 -> bond0 -> bond0.XXX vlan setup. Additional bond0.YYY are created later on with puppet. Them main problem is that some vlans have MTU 9000 and therefore they need bond0 (and em1 and em2) to have MTU 9000 as well. The system/installation vlan XXX is, however, with MTU 1500 only so I cannot put the IP on the bond0 interface directly. So far cobbler did not create fixed address entries in DHCP ("fixed-address X.X.X.X;") if there was no IP on emX or bond0 but only on bond0.XXX. This fix adds the fixed address from the 'first' vlan interface on top of the bond device, if the bond device itself does not have an IP. --- cobbler/modules/manage_isc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cobbler/modules/manage_isc.py b/cobbler/modules/manage_isc.py index 999e1499df..fe533cf1d1 100644 --- a/cobbler/modules/manage_isc.py +++ b/cobbler/modules/manage_isc.py @@ -106,6 +106,14 @@ def write_dhcp_file(self): # exist continue ip = system.interfaces[interface["interface_master"]]["ip_address"] + if ip is None or ip == "": + for (nam2, int2) in system.interfaces.iteritems(): + if (nam2.startswith(interface["interface_master"] + ".") + and int2["ip_address"] is not None + and int2["ip_address"] != ""): + ip = int2["ip_address"] + break + interface["ip_address"] = ip host = system.interfaces[interface["interface_master"]]["dns_name"] interface["if_gateway"] = system.interfaces[interface["interface_master"]]["if_gateway"]