From f326fd99e2e846f9e61e6913fcade01c2e726baf Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 6 Jan 2020 22:31:37 -0500 Subject: [PATCH] Properly fix IPv4 no-DHCP networking --- node-daemon/pvcd/VXNetworkInstance.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/node-daemon/pvcd/VXNetworkInstance.py b/node-daemon/pvcd/VXNetworkInstance.py index 311e255d..e7dfa5a0 100644 --- a/node-daemon/pvcd/VXNetworkInstance.py +++ b/node-daemon/pvcd/VXNetworkInstance.py @@ -660,7 +660,6 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out '--leasefile-ro', '--dhcp-script={}/pvcd/dnsmasq-zookeeper-leases.py'.format(os.getcwd()), '--dhcp-hostsdir={}'.format(self.dnsmasq_hostsdir), - '--interface={}'.format(self.bridge_nic), '--bind-interfaces', ] dhcp_configuration_v4 = [ @@ -669,6 +668,8 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out '--auth-peer={}'.format(self.ip4_gateway), '--auth-server={}'.format(self.ip4_gateway), '--auth-sec-servers={}'.format(self.ip4_gateway), + ] + dhcp_configuration_v4_dhcp = [ '--dhcp-option=option:ntp-server,{}'.format(self.ip4_gateway), '--dhcp-range={},{},48h'.format(self.dhcp4_start, self.dhcp4_end), ] @@ -690,14 +691,16 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out # Assemble the DHCP configuration dhcp_configuration = dhcp_configuration_base - if self.dhcp4_flag: - dhcp_configuration += dhcp_configuration_v4 if self.dhcp6_flag: dhcp_configuration += dhcp_configuration_v6 if self.dhcp4_flag: dhcp_configuration += dhcp_configuration_v6_dualstack else: dhcp_configuration += dhcp_configuration_v6_only + else: + dhcp_configuration += dhcp_configuration_v4 + if self.dhcp4_flag: + dhcp_configuration += dhcp_configuration_v4_dhcp # Start the dnsmasq process in a thread print('/usr/sbin/dnsmasq {}'.format(' '.join(dhcp_configuration)))