Skip to content

Commit

Permalink
WIP for fixing the nat node
Browse files Browse the repository at this point in the history
Ref #686
  • Loading branch information
julien-duponchelle committed Sep 23, 2016
1 parent dc798da commit 2ca8bce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions gns3server/compute/builtin/nodes/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def _add_ubridge_connection(self, nio, port_number):

if sys.platform.startswith("linux"):
# use raw sockets on Linux
yield from self._ubridge_send('bridge add_nio_linux_raw {name} "{interface}"'.format(name=bridge_name,
interface=port_info["interface"]))
yield from self._ubridge_send('bridge add_nio_ethernet {name} "{interface}"'.format(name=bridge_name,

This comment has been minimized.

Copy link
@grossmj

grossmj Sep 23, 2016

Member

This will require lib pcap to be installed.

This comment has been minimized.

Copy link
@julien-duponchelle

julien-duponchelle via email Sep 23, 2016

Author Contributor
interface=port_info["interface"]))
else:
if sys.platform.startswith("darwin"):
# Wireless adapters are not well supported by the libpcap on OSX
Expand All @@ -214,8 +214,9 @@ def _add_ubridge_connection(self, nio, port_number):
interface=port_info["interface"]))

elif port_info["type"] == "tap":
yield from self._ubridge_send('bridge add_nio_tap {name} "{interface}"'.format(name=bridge_name,
interface=port_info["interface"]))
yield from self._ubridge_send('bridge add_nio_tap {name} "{interface}"'.format(name=bridge_name, interface=port_info["interface"]))
if port_info["interface"].startswith("nat"):
yield from self._ubridge_send('brctl addif virbr0 "{interface}"'.format(interface=port_info["interface"]))

elif port_info["type"] == "udp":
yield from self._ubridge_send('bridge add_nio_udp {name} {lport} {rhost} {rport}'.format(name=bridge_name,
Expand Down
4 changes: 2 additions & 2 deletions gns3server/compute/builtin/nodes/nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def __init__(self, *args, **kwargs):
ports = [
{
"name": "nat0",
"type": "ethernet",
"interface": "virbr0",
"type": "tap",
"interface": "nat0",
"port_number": 0
}
]
Expand Down

0 comments on commit 2ca8bce

Please sign in to comment.