<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 17, 2013 at 5:43 PM, Steven Newbury <span dir="ltr"><<a href="mailto:steve@snewbury.org.uk" target="_blank">steve@snewbury.org.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><u></u>
<div>
<p></p><div><div class="h5">On Sun, 17 Nov 2013, 21:12:45 GMT, Reuben Hawkins <<a href="mailto:reubenhwk@gmail.com" target="_blank">reubenhwk@gmail.com</a>> wrote:
<br>
<br>> Does anybody know how to create a tun/tap interface on which RADVD can be
<br>> tested?
<br>>
<br>> I'd like to create some tests and I'm thinking that creating a virtual
<br>> network interface on which RADVD will advertise and listen would be the
<br>> best way to test, but I don't have any experience creating virtual
<br>> interfaces. Any pointer to get me started would be very helpful.
<br>>
<br>> My setup will be as follows...
<br>>
<br>> 1) Create virtual interface(s)
<br>> 2) point RADVD to this interface(s) in radvd.conf
<br>> 3) write some tests to connect to the other end of the interface and send
<br>> solicitations to radvd to test out as many radvd configurations, features
<br>> and behaviors as possible.
<br>>
<br></div></div>Best bet would probably be to create a bridge interface, then run 1 or more VMs under QEMU with virtio/tap interfaces. That way everything is kept isolated on each side of the tap.<br><p></p>
</div>
</blockquote></div>Running VM's is overkill. I can't commit filesystems, etc to radvd for testing. I need something with which I can make simple tests. I'm finding this to be working so far...<div><br></div>
<div><div>ip link add $IFACE_NAME type dummy</div><div>ifconfig $IFACE_NAME up<br></div></div><div><br></div><div>I'd like to be able to do that in a c program. When I do that on the command line, I can run radvd on that interface in one terminal, and run radvdump in another..and it seems to work. I'd like to be able to create the interface in a c program, then redirect stdout/stderr and fork an instance of radvd and radvdump, then compare the outputs to make sure it's all working.</div>
<div><br></div><div>I have a c program which creates tuntap interfaces (I found the code here <a href="http://backreference.org/2010/03/26/tuntap-interface-tutorial/">http://backreference.org/2010/03/26/tuntap-interface-tutorial/</a>)</div>
<div><br></div><div>...so I guess what I need to do is expand on my tuntap.c to create an interface of type "dummy".</div><div><br></div><div>As a side note, I found that RADVD is unable to get the MTU and the hardware address from a dummy interface in one call to ioctl, but it can get both if queried individually. Seems like maybe a kernel bug...not sure.</div>
<div><br></div></div></div>