Skip to content

TapDevice

Saverio Proto edited this page Jun 25, 2012 · 2 revisions

Notes on tun/tap on Planet Lab

if you need a tun tap on planet lab make sure you slice has the following administrative tags enabled:

vsys / fd_tuntap
vsys / vif_up
vsys_vnet / 172.16.2.0/24

where 172.16.2.0/24 is an example subnet

To create a tap device on a node in Planet-lab make sure you have the folder /vsys on each node. This happens when the tag settings on the slice have propagated on all the machines. After this check compile and launch the file : source:planet-lab/tuntap/tuntest.c

You can find the original tuntap support files here: http://svn.planet-lab.org/svn/vsys-scripts/trunk/support/

This program allocate a new tap device on the nodes. While this program is running (you need that this program does not end) type these commands on the node shell:


cat /vsys/vif_up.out&

[0] cat>  /vsys/vif_up.in
      <name of interface, i.e. [tun|tap]<sliceid>-n
      <ip address e.g. 172.16.2.1>
      <netmask e.g. 24>
      <options as newline-separated name-value pairs>
      <Control-D>

I have created a file that contains tap<sliceid></sliceid>-n ip_address netmask like this :

tap1297-0
172.16.2.5
24

and instead of the command ![0] I have used this :

cat file > /vsys/vif_up.in

After this you may see a new tap interface typing the ```ifconfig``` command. For example after this procedure i have a new tap device like this :

tap1297-0 Link encap:Ethernet  HWaddr 00:FF:53:FE:4E:0B  
          inet addr:172.16.2.5  Bcast:172.16.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
Clone this wiki locally