View previous topic :: View next topic |
Author |
Message |
swingman Tux's lil' helper

Joined: 19 Mar 2003 Posts: 88 Location: Sweden
|
Posted: Sat Jul 26, 2008 7:13 am Post subject: [SOLVED] help with /etc/conf.d for tun/tap bridge vlan |
|
|
I try to create a set of tun/tap interfaces, to run on a bridge on a VLAN over a physical network interface. If I set things up manually, it works. My current /etc/conf.d/net works providing I activate the interfaces manually. They fail completely to correctly resolve dependencies and start at boot-time.
Here's the current /etc/conf.d/net
Code: |
preup() {
VLAN=$(echo "${IFACE}" | grep v)
if [[ "${VLAN}" ]]; then
VNUM=$(echo "${IFACE}" | awk -F'v' '{print $2;}')
# We need to bring the newly created vlan2 device down to rename it
CMDTMP="CMD=\"ip link set vlan${VNUM} down\""
eval $CMDTMP && ebegin "$CMD" && $CMD &>/tmp/error
ewend $? $(cat /tmp/error && rm -f /tmp/error)
# Then we rename it to our real interface-specific name
CMDTMP="CMD=\"ip link set vlan${VNUM} name ${IFACE}\""
eval $CMDTMP && ebegin "$CMD" && $CMD &>/tmp/error
ewend $? $(cat /tmp/error && rm -f /tmp/error)
# Then we bring the interface back up
CMDTMP="CMD=\"ip link set ${IFACE} up\""
eval $CMDTMP && ebegin "$CMD" && $CMD &>/tmp/error
ewend $? $(cat /tmp/error && rm -f /tmp/error)
fi
}
tuntap_box0="tap"
config_box0=( "null" )
tuntap_box1="tap"
config_box1=( "null" )
config_eth1=( "null" )
vlans_eth1="1"
vconfig_eth1=( "set_name_type VLAN_PLUS_VID_NO_PAD" )
config_vlan1=( "null" )
depend_e1v1()
{
need net.vlan1 net.eth1
}
config_e1v1=( "null" )
vconfig_e1v1=( "set_flag 1" )
depend_dmz0()
{
use net.e1v1 net.vlan # need fails
after net.lan0
need net.box0 net.box1
}
bridge_dmz0=( "e1v1 box0 box1" )
brctl_dmz0=( "stp on" )
brctl_dmz0=( "setfd 0" )
config_dmz0=( "192.168.0.1 netmask 255.255.255.0" )
bridge_lan0=( "eth1" )
brctl_lan0=( "stp on" )
config_lan0=( "192.168.1.1 netmask 255.255.255.0" )
|
net.dmz0, net.e1v1, net.eth0 and net.lan0 are all in runlevel default.
If I activate net.e1v1 by hand, it works. If I activate net.dmz0 after net.e1v1 it often fails the first time, but a retry a second later almost always works, so there seems to be a race.
However, if I reboot the machine, net.e1v1 and net.dmz0 are never started. dmesg shows:
Code: |
Jul 26 08:27:32 quetzalcoatlus tun: Universal TUN/TAP device driver, 1.6
Jul 26 08:27:32 quetzalcoatlus tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
Jul 26 08:27:32 quetzalcoatlus Bridge firewalling registered
Jul 26 08:27:32 quetzalcoatlus lan0: Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature.
Jul 26 08:27:32 quetzalcoatlus lan0: starting userspace STP failed, starting kernel STP
Jul 26 08:27:32 quetzalcoatlus device eth1 entered promiscuous mode
Jul 26 08:27:32 quetzalcoatlus tg3: eth1: Link is up at 1000 Mbps, full duplex.
Jul 26 08:27:32 quetzalcoatlus tg3: eth1: Flow control is on for TX and on for RX.
Jul 26 08:27:32 quetzalcoatlus lan0: port 1(eth1) entering listening state
Jul 26 08:27:32 quetzalcoatlus dmz0: Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature.
Jul 26 08:27:32 quetzalcoatlus r8169: eth0: link up
Jul 26 08:27:32 quetzalcoatlus 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
Jul 26 08:27:32 quetzalcoatlus All bugs added by David S. Miller <davem@redhat.com>
|
Aren't things done in the wrong order here? dmz0 uses the vlan, but the 802.1Q driver isn't loaded until after the log line for dmz0.
After boot, net.e1v1 and net.dmz0 are in stopped state, the rest is up. Activating them manually works.
If I change the dependencies for net.dmz0 to read:
Code: |
depend_dmz0()
{
after net.lan0
need net.e1v1 net.box0 net.box1
}
|
I get this error:
Code: |
bjorn@quetzalcoatlus ~ $ sudo /etc/init.d/net.dmz0 broken
* Caching service dependencies ...
* Can't find service 'net.e1v1' needed by 'net.dmz0'; continuing... [ ok ]
net net.e1v1
bjorn@quetzalcoatlus ~ $
|
I admit I am not too versed in /etc/conf.d/net, but I'd really like to see this work. What should my conf look like?
_
/Bjorn
Last edited by swingman on Sat Jul 26, 2008 10:21 am; edited 1 time in total |
|
Back to top |
|
 |
swingman Tux's lil' helper

Joined: 19 Mar 2003 Posts: 88 Location: Sweden
|
Posted: Sat Jul 26, 2008 10:21 am Post subject: [SOLVED] help with /etc/conf.d for tun/tap bridge vlan |
|
|
Well, there might have been errors in conf.d/net, but the real error was elsewhere. In /etc/init.d, net.eth1 was a symlink to net.eth0, and net.e1v1 was a symlink to net.eth1, instead of both symlinking to net.lo. Changing that made it work.
_
/Bjorn |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|