@classmethod
def _register_attributes(cls):
- endpoint_ip = Attribute("endpoint_ip", "IPv4 Address",
+ ip = Attribute("ip", "IPv4 Address",
flags = Flags.Design)
mac = Attribute("mac", "MAC Address",
flags = Flags.Design)
- endpoint_prefix = Attribute("endpoint_prefix", "IPv4 network prefix",
- type = Types.Integer,
+ prefix = Attribute("prefix", "IPv4 network prefix",
flags = Flags.Design)
mtu = Attribute("mtu", "Maximum transmition unit for device",
"Bash script to be executed before releasing the resource",
flags = Flags.Design)
- cls._register_attribute(endpoint_ip)
+ cls._register_attribute(ip)
cls._register_attribute(mac)
- cls._register_attribute(endpoint_prefix)
+ cls._register_attribute(prefix)
cls._register_attribute(mtu)
cls._register_attribute(devname)
cls._register_attribute(up)
def _udp_connect_command(self, remote_endpoint, connection_run_home,
cipher, cipher_key, bwlimit, txqueuelen):
- # Set the remote endpoint
- self.set("pointopoint", remote_endpoint.get("endpoint_ip"))
+ # Set the remote endpoint to the IP of the device
+ self.set("pointopoint", remote_endpoint.get("ip"))
# Planetlab TAPs always use PI headers
from nepi.resources.planetlab.tap import PlanetlabTap
if self.is_rm_instance(PlanetlabTap.get_rtype()):
self.set("pi", True)
+ # Public IP of the remote NODE to stablish tunnel
remote_ip = remote_endpoint.node.get("ip")
local_port_file = os.path.join(self.run_home,
return command
def _gre_connect_command(self, remote_endpoint, connection_run_home):
- # Set the remote endpoint
- self.set("pointopoint", remote_endpoint.get("endpoint_ip"))
+ # Set the remote endpoint to (private) device IP
+ self.set("pointopoint", remote_endpoint.get("ip"))
+ ## public node IP
self.set("greRemote", remote_endpoint.node.get("ip"))
# Generate GRE connect command
self.vif_prefix,
"pi" if self.get("pi") else ""))
start_command.append("sudo -S ip link set %s up" % self.get("deviceName"))
- start_command.append("sudo -S ip addr add %s/%d dev %s" % (
- self.get("endpoint_ip"),
- self.get("endpoint_prefix"),
+ start_command.append("sudo -S ip addr add %s/%s dev %s" % (
+ self.get("ip"),
+ self.get("prefix"),
self.get("deviceName"),
))
self.node.get("ip"),
self.get("greKey")
))
- command.append("sudo -S ip addr add %s/%d peer %s/%d dev %s" % (
- self.get("endpoint_ip"),
- self.get("endpoint_prefix"),
+ command.append("sudo -S ip addr add %s/%s peer %s/%s dev %s" % (
+ self.get("ip"),
+ self.get("prefix"),
self.get("pointopoint"),
- self.get("endpoint_prefix"),
+ self.get("prefix"),
self.get("deviceName"),
))
command.append("sudo -S ip link set %s up " % self.get("deviceName"))