Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: How to setup a TUN/TAP interface using OpenRC (Read 270 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to setup a TUN/TAP interface using OpenRC

I want Qemu to use a tap network interface, so a VM run by Qemu can access both services the host opens on the private IP, and the Internet. Port forwarding of Qemu behaves unstable in my personal experience.

Actually, I found a script that seems to work. However, I can not turn it into configurations in /etc/conf.d/net.

Examples in the file suggest the following two lines would work:
Code: [Select]
tuntap_tap0="tap0"
config_tap0="10.0.0/24"
And then
Code: [Select]
> ls -l /etc/init.d/net.*
/etc/init.d/net.lo
/etc/init.d/net.tap0 -> net.lo
> sudo /etc/init.d/net.tap0 start
 * Caching service dependencies ...                                                                                                                                 [ ok ]
 * Bringing up interface tap0
 *   Creating Tun/Tap interface tap0 ...
Unknown tunnel mode "tap0"                                                                                                                                          [ !! ]
 * ERROR: net.tap0 failed to start

So, what's the proper way to do this?

 

Re: How to setup a TUN/TAP interface using OpenRC

Reply #1
Try dropping the 0.
Code: [Select]
tuntap_tap0="tap"