nat_net_id = None
site_net_id = None
-quantum_auth_url = "http://viccidev1:5000/v2.0/"
+quantum_auth_url = None
quantum_username = None
quantum_password = None
quantum_tenant_name = None
# Enable dnsmasq for this interface.
# It's possible that we could get by with a single instance of dnsmasq running on
# all devices but I haven't tried it.
-def start_dnsmasq(dev, interface):
+def start_dnsmasq(dev, interface, forward_dns=True):
if not dnsmasq_running(dev):
# The '--dhcp-range=<IP addr>,static' argument to dnsmasq ensures that it only
# hands out IP addresses to clients listed in the hostsfile
'--dhcp-no-override',
'--dhcp-range=%s,static' % interface['ip']]
+ # Turn off forwarding DNS queries, only do DHCP
+ if forward_dns == False:
+ cmd.append('--port=0')
+
try:
logger.log('%s: starting dnsmasq on device %s' % (plugin, dev))
subprocess.check_call(cmd)
# the nat:forward_ports field in the Port record.
def set_up_port_forwarding(dev, ports):
for port in ports:
- if port['network_id'] == nat_net_id:
+ if port['network_id'] == nat_net_id and port['nat:forward_ports']:
for fw in port['nat:forward_ports']:
ipaddr = port['fixed_ips'][0]['ip_address']
protocol = fw['l4_protocol']
global quantum_username
global quantum_password
global quantum_tenant_name
+ global quantum_auth_url
logger.log("%s: plugin starting up..." % plugin)
quantum_username = parser.get("DEFAULT", "quantum_admin_username")
quantum_password = parser.get("DEFAULT", "quantum_admin_password")
quantum_tenant_name = parser.get("DEFAULT", "quantum_admin_tenant_name")
-
+ quantum_auth_url = parser.get("DEFAULT", "quantum_admin_auth_url")
def GetSlivers(data, config=None, plc=None):
global nat_net_id
if 'OVS_BRIDGE' in tags:
dev = tags['OVS_BRIDGE']
write_dnsmasq_hostsfile(dev, ports, site_net_id)
- start_dnsmasq(dev, interface)
+ start_dnsmasq(dev, interface, forward_dns=False)