Ticket #168 (closed defect: fixed)
Opened 16 months ago
Last modified 16 months ago
handling tap interfaces with /etc/init.d/network
Reported by: | osi2897@i2pmail.org | Owned by: | roy |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | rc | Version: | |
Keywords: | Cc: | osi2897@i2pmail.org |
Description
Please document how to use the tunctl command to generate a tap interface with the new /etc/init.d/network script.
The old net.*-scripts worked with:
tuntap_vbox0="tap"
tunctl_vbox0="-u misa"
config_vbox0=( "null" )
in /etc/conf.d/net.
What is the solution with the new single network script?
Change History
comment:2 Changed 16 months ago by roy
# Instruct network about virtual interfaces interfaces="vbox0" # Using tunctl ifup_vbox0="tunctl -t \$int" ifdown_vbox0="tunctl -d \$int" # Or if using OpenVPN ifup_vbox0="openvpn --mktun --dev-type tap --dev \$int" ifdown_vbox0="openvpn --rmtun --dev-type tap --dev \$int"
The question though is why document the creation of a tun/tap interface?
OpenVPN can create the interface itself and has it's own init script.
comment:3 Changed 16 months ago by osi2897
A bridged tun/tap interface is needed for VirtualBox?.
I have this section in /etc/conf.d/network:
ifconfig_eth0="0.0.0.0" interfaces="vbox0" ifconfig_vbox0="0.0.0.0" ifup_vbox0="tunctl -t \$int" ifdown_vbox0="tunctl -d \$int" defaultroute="192.168.178.1" interfaces="br0" ifconfig_br0="192.168.178.20 netmask 255.255.255.0" ifup_br0="brctl addbr \$int; brctl setfd \$int 0; brctl stp \$int off; brctl ad$ ifdown_br0="ifconfig \$int down; brctl delbr \$int"
/etc/init.d/network -v start gives:
* Starting network * eth0... * 0.0.0.0... [ok] * br0... * brctl addbr $int... [ok] * brctl setfd $int 0... [ok] * brctl stp $int off... [ok] * brctl addif $int eth0... [ok] * brctl addif $int vbox0... interface vbox0 does not exist! [!!] * 192.168.178.20 netmask 255.255.255.0... [ok] * Setting default route 192.168.178.1... [ok]
comment:4 Changed 16 months ago by roy
You should only have one interfaces line
interfaces="vbox0 br0"
I've just committed a fix for --verbose showing $int instead of the interface name.
comment:5 Changed 16 months ago by osi2897
Great, it was the interfaces line (perhaps some more documentation/examples would help). And thanks for the fix for --verbose. Now vbox0 and br0 start without errors.
Only /etc/init.d/network -v gives "[!!]" (but both br0 and vbox0 are stopped).
* Stopping network * br0... * ifconfig br0 down... [ok] * brctl delbr br0... [!!] * vbox0... * tunctl -d vbox0... Set 'vbox0' nonpersistent [!!] * eth0... [ok]
comment:6 Changed 16 months ago by roy
Interesting. That implies both commands returned non zero.
Could you attach (ie don't inlcude in a comment) the output of the same command, but with --debug please?