1
0
mirror of https://github.com/GNS3/gns3-server synced 2025-01-13 09:30:54 +00:00

Handle vmnet interfaces in the cloud on OSX. Fixes #554.

This commit is contained in:
grossmj 2016-06-09 19:00:33 -06:00
parent a35f41e4dc
commit 3c9e8507d1

View File

@ -165,7 +165,13 @@ class Cloud(BaseNode):
interface=port_info["interface"])) interface=port_info["interface"]))
else: else:
if sys.platform.startswith("darwin") and port_info["interface"].startswith("en"): if sys.platform.startswith("darwin") and port_info["interface"].startswith("en"):
# Wireless adapters are not well supported by the libpcap on OSX
raise NodeError("Connecting to a Wireless adapter is not supported.") raise NodeError("Connecting to a Wireless adapter is not supported.")
if sys.platform.startswith("darwin") and port_info["interface"].startswith("vmnet"):
# Use a special NIO to connect to VMware vmnet interfaces on OSX (libpcap doesn't support them)
yield from self._ubridge_send('bridge add_nio_fusion_vmnet {name} "{interface}"'.format(name=bridge_name,
interface=port_info["interface"]))
else:
yield from self._ubridge_send('bridge add_nio_ethernet {name} "{interface}"'.format(name=bridge_name, yield from self._ubridge_send('bridge add_nio_ethernet {name} "{interface}"'.format(name=bridge_name,
interface=port_info["interface"])) interface=port_info["interface"]))