mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 16:36:16 +00:00
Allows the creation of non-existent TAP interfaces when using the cloud.
This commit is contained in:
parent
c8f37381f4
commit
4eb03b5a99
@ -162,9 +162,6 @@ class Cloud(BaseNode):
|
|||||||
rport=nio.rport))
|
rport=nio.rport))
|
||||||
|
|
||||||
if port_info["type"] in ("ethernet", "tap"):
|
if port_info["type"] in ("ethernet", "tap"):
|
||||||
network_interfaces = [interface["name"] for interface in interfaces()]
|
|
||||||
if not port_info["interface"] in network_interfaces:
|
|
||||||
raise NodeError("Interface '{}' could not be found on this system".format(port_info["interface"]))
|
|
||||||
|
|
||||||
if sys.platform.startswith("win"):
|
if sys.platform.startswith("win"):
|
||||||
windows_interfaces = interfaces()
|
windows_interfaces = interfaces()
|
||||||
@ -181,6 +178,10 @@ class Cloud(BaseNode):
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
if port_info["type"] == "ethernet":
|
if port_info["type"] == "ethernet":
|
||||||
|
network_interfaces = [interface["name"] for interface in interfaces()]
|
||||||
|
if not port_info["interface"] in network_interfaces:
|
||||||
|
raise NodeError("Interface '{}' could not be found on this system".format(port_info["interface"]))
|
||||||
|
|
||||||
if sys.platform.startswith("linux"):
|
if sys.platform.startswith("linux"):
|
||||||
# use raw sockets on Linux
|
# use raw sockets on Linux
|
||||||
yield from self._ubridge_send('bridge add_nio_linux_raw {name} "{interface}"'.format(name=bridge_name,
|
yield from self._ubridge_send('bridge add_nio_linux_raw {name} "{interface}"'.format(name=bridge_name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user