NSX|V3: honor host routes
If host routes are configured on a subnet then we need to make sure that they are part of the 121 options on the DHCP static binding. Change-Id: Iec37c96ddae17622fc26d4ae1961a14afcea566c
This commit is contained in:
parent
0b1840a209
commit
743a082102
|
@ -1825,11 +1825,16 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
||||||
ip, port):
|
ip, port):
|
||||||
try:
|
try:
|
||||||
hostname = 'host-%s' % ip.replace('.', '-')
|
hostname = 'host-%s' % ip.replace('.', '-')
|
||||||
gateway_ip = self.get_subnet(
|
subnet = self.get_subnet(context, subnet_id)
|
||||||
context, subnet_id).get('gateway_ip')
|
gateway_ip = subnet.get('gateway_ip')
|
||||||
options = self._get_dhcp_options(
|
options = self._get_dhcp_options(
|
||||||
context, ip, port.get(ext_edo.EXTRADHCPOPTS),
|
context, ip, port.get(ext_edo.EXTRADHCPOPTS),
|
||||||
port['network_id'])
|
port['network_id'])
|
||||||
|
# update static routes
|
||||||
|
for hr in subnet['host_routes']:
|
||||||
|
options['option121']['static_routes'].append(
|
||||||
|
{'network': hr['destination'],
|
||||||
|
'next_hop': hr['nexthop']})
|
||||||
binding = self.nsxlib.dhcp_server.create_binding(
|
binding = self.nsxlib.dhcp_server.create_binding(
|
||||||
dhcp_service_id, port['mac_address'], ip, hostname,
|
dhcp_service_id, port['mac_address'], ip, hostname,
|
||||||
cfg.CONF.nsx_v3.dhcp_lease_time, options, gateway_ip)
|
cfg.CONF.nsx_v3.dhcp_lease_time, options, gateway_ip)
|
||||||
|
|
Loading…
Reference in New Issue