Gerard Beekmans wrote:
Attached ipv4-static-vlan and the plain diff of it against ipv4-static since it just adds a couple of VLAN related lines.

IMO, this is completely the wrong way to go. Creating VLAN interfaces should be the domain of a "vlan" service script, not "ipv4-static", which assigns IPV4 addresses to existing interfaces.


This is what I use:

#!/bin/sh
# Begin $network_devices/services/vlan

# Written by Kevin P. Fleming <[EMAIL PROTECTED]>

. /etc/sysconfig/rc
. $rc_functions
. $IFCONFIG

if [ -z "$VLAN" ]; then
        echo "VLAN variable missing from $IFCONFIG, cannot continue"
        exit 1
fi

case "$2" in
        up)
                echo "Adding VLAN $VLAN to the $1 interface..."
                vconfig add $1 $VLAN > /dev/null
                evaluate_retval
        ;;
        
        down)
                echo "Removing VLAN $VLAN from the $1 interface..."
                vconfig rem $1.$VLAN > /dev/null
                evaluate_retval
        ;;
        
        *)
                echo "Usage: $0 [interface] {up|down}"
                exit 1
        ;;
esac

# End $network_devices/services/vlan

Then, in the ifconfig.eth0 directory, I create two files called "vlan10" and "vlan20". Each of these files looks like this:

ONBOOT=yes
SERVICE=vlan
VLAN=10 (or 20)

I then have two more directories, named ifconfig.eth0.10 and ifconfig.eth0.20, which each contain an "ipv4" file that uses the ipv4-static script to assign an IP address to that VLAN interface.

This works very well, I have no trouble with "link up" being applied to the wrong place (although I've not yet updated to Nathan's latest bootscripts, which have been changed for some reason I don't understand...)
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to