diff options
| author | mathrock <nathanael.i.burton@gmail.com> | 2012-07-28 14:38:43 -0400 |
|---|---|---|
| committer | mathrock <nathanael.i.burton@gmail.com> | 2012-07-28 14:38:43 -0400 |
| commit | cefb87511c4eae22c46f25da7335b4beb4631c4a (patch) | |
| tree | 18e18df09ccbdfc5b0fa7827e883b2a857f0da5f | |
| parent | bad0a496c0e765da3cc879235c988b7cc617f367 (diff) | |
| download | nova-cefb87511c4eae22c46f25da7335b4beb4631c4a.tar.gz nova-cefb87511c4eae22c46f25da7335b4beb4631c4a.tar.xz nova-cefb87511c4eae22c46f25da7335b4beb4631c4a.zip | |
Support external gateways in VLAN mode.
Add network label when starting dnsmasq. Fixes bug 1012443.
To allow for per-network dnsmasq customization we can use the network
label from the database as the dnsmasq network tag. A user can then
specify a custom dnsmasq config file using the 'dnsmasq_config_file'
configuration flag.
An example dnsmasq config file showing how to set a custom external
gateway or ntp server for particular networks based on their tag/label
follows:
dhcp-option=tag:'private',option:router,10.0.0.254
dhcp-option=tag:'private',option:ntp-server,10.0.0.253
dhcp-option=tag:'private',option:dns-server,8.8.8.8
dhcp-option=tag:'blue',option:router,10.10.0.254
dhcp-option=tag:'blue',option:ntp-server,10.10.0.253
dhcp-option=tag:'blue',option:dns-server,8.8.4.4
Change-Id: I56cb175a968e33b803dfcb965f90f3a5ca4983ca
| -rw-r--r-- | nova/network/linux_net.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py index d5c6bb459..7799052fe 100644 --- a/nova/network/linux_net.py +++ b/nova/network/linux_net.py @@ -724,8 +724,10 @@ def restart_dhcp(context, dev, network_ref): '--pid-file=%s' % _dhcp_file(dev, 'pid'), '--listen-address=%s' % network_ref['dhcp_server'], '--except-interface=lo', - '--dhcp-range=%s,static,%ss' % (network_ref['dhcp_start'], - FLAGS.dhcp_lease_time), + '--dhcp-range=set:\'%s\',%s,static,%ss' % + (network_ref['label'], + network_ref['dhcp_start'], + FLAGS.dhcp_lease_time), '--dhcp-lease-max=%s' % len(netaddr.IPNetwork(network_ref['cidr'])), '--dhcp-hostsfile=%s' % _dhcp_file(dev, 'conf'), '--dhcp-script=%s' % FLAGS.dhcpbridge, |
