← Back to team overview

marionnet-dev team mailing list archive

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

 

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 addresses, 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

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

-- 
Simon

Follow ups