13 | | TODO: {{{vde_plug2tap}}} |
| 13 | Each interface on the experimental network will be assigned a VDE switch and port number. If your platform supports VDE natively, then you're done! |
| 14 | |
| 15 | For platforms that do not have VDE support, TAP support is sufficient. {{{vde_plug2tap}}} acts as an adapter between a VDE switch port and a TAP interface. VDE also comes with {{{vde_tunctl}}} which can create TAP interfaces on the fly to be used by other apps. |
| 16 | |
| 17 | The following example illustrates how one might do this with QEMU. QEMU has native VDE support, but we'll assume for a moment that we can't use it: |
| 18 | |
| 19 | {{{ |
| 20 | #!/bin/sh |
| 21 | |
| 22 | SWITCH_SOCKET=$1 |
| 23 | SWITCH_PORT=$2 |
| 24 | |
| 25 | vde_tunctl tap0 |
| 26 | vde_plug2tap -d -s $SWITCH_SOCKET -p $SWITCH_PORT |
| 27 | qemu -net nic -net tap,ifname=tap0 fs.img |
| 28 | }}} |
| 29 | |
| 30 | If you don't even have TAP support.. get creative. Chances are if you can talk to a file descriptor pair {{{vde_plug}}} will work for you. |