← Back to team overview

marionnet-dev team mailing list archive

Re: Many TAP interfaces with paired 172.23.0.1 in case of several concurrently running Marionnet projects

 

Hi Simon,

in the original project we had the idea of supporting several Marionnet instances on the same host. But this idea was rapidly forgot when we have observed the number of concurrent processes running for a single instance. So, the design of Marionnet reflects some ideas in this direction but the feature isn't completely supported.

Is there any way to insure that assignment of IP addresses to
Marionnet hosts will be unique?

Not in the current status of code, even if the patch seems not so hard to implement. If you really want, I can plan it in the TODO list, but in my opinion there are many critical points to analyse and test to be sure that the feature is really implemented. You have found a problem but it is probably not the only problem.

However, I believe that there exists a workaround for you, exploiting the IPv6 adressing (and routing, because your problem is about routing). If you are really interested and not discouraged by my previous speech, I can explain this idea in details.

Best regards,
Jean-Vincent Loddo

On Fri, 24 Apr 2015 16:36:23 -0400, Simon Baev wrote:
Hello,

I am running Marionnet in a classroom environment on LTSP server. Our
students can run multiple concurrent Marionnet sessions to work on
several concurrently running projects.

Each Marionnet host creates a TAP interface on the server side with IP 172.23.0.254 which at the other end is connected to Marionnet host. My
intend was to make possible to ssh to Marionnet hosts  from Ubuntu
terminal because it is MORE CONVENIENT compared to XTERM which is
bound by default to remote host(s).

I created and started two projects,  then, on every Marionnet host I
activated SSH service allowing root login. The problem I'm facing is
inability to determine which IP address to SSH from HOST (Ubuntu) to
reach particular Marionnet hosts. 

I ran NETSTAT -RN  to find out association between particular TAP
interfaces and their matching remote IP a ddresses, here is a snippet
of exampled output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS
Window  irtt Iface
0.0.0.0         168.18.104.33   0.0.0.0         UG      
 0 0          0 eth0
10.0.16.0       0.0.0.0         255.255.255.0   U        
0 0          0 eth1
168.18.104.32   0.0.0.0         255.255.255.240 U         0 0
         0 eth0
172.23.0.1      0.0.0.0         255.255.255.255 UH        0
0 � �        0 tap143133
172.23.0.1      0.0.0.0         255.255.255.255 UH        0
0          0 tap144015
172.23.0.2      0.0.0.0         255.255.255.255 UH        0
0          0 tap563104
172.23.0.2      0.0.0.0         255.255.255.255 UH        0
0          0 tap571651
172.23.0.3      0.0.0.0         255.255.255.255 UH        0
0          0 tap154589

I came up with a small script that looks at /TMP/MARIONNET* files and
determines IP addresses that particular user runs:

#!/ bin/bash
if [ $# -lt 1 ]; then

   echo "Need one parameter -- name of the MarionNet project" 1>&2
   exit 1
fi
mhome=$(find /tmp -name "marionnet*" -user $(whoami) 2> /dev/null)

if [ ! -d "$mhome/$1" ]; then

   echo "Project '$1' doesn't exist" 1>&2
   exit 2
fi
for hostinfo in $mhome/$1/hostfs/*; do

   awk -F"'" '/ip42|hostname/{print $2}' "$hostinfo/boot_parameters"
done | paste -s -d",n"
 
this script prints something similar to:

172.23.0.1,R1
172.23.0.2,m1
172.23.0.3,m2

for one project, and
< br>

172.23.0.1,mt1
172.23.0.2,mt2

for another. 

I can see that two different projects have 172.23.0.1 associated with
their first internal host, i.e. with R1 on one project and with MT1 on another project. When I SSH to 172.23.0.1 from Ubuntu host I'm getting
to R1. Is there any way to insure that assignment of IP addresses to
Marionnet hosts will be unique?

Thank you.

--
Simon



References