File:  [ELWIX - Embedded LightWeight unIX -] / elwix / config / etc / uboot / rc.d / 013.vlan0.stop
Revision 1.2.2.1: download - view: text, annotated - select for diffs - revision graph
Thu Mar 5 22:58:33 2015 UTC (9 years, 6 months ago) by misho
Branches: elwix2_3
Diff to: branchpoint 1.2: preferred, colored
rework vlan scripts

#!/bin/sh

IFACE="vlan0"

VLAN="1"
VLANDEV="em0"

OPTS=""
#IP="auto"
IP="192.168.0.1/24"
#IP6="auto"
IP6=""

[ -z "$IFACE" -o -z "$VLANDEV" ] && exit

echo "Config VLAN #$VLAN network interface $IFACE ..."

ifconfig $IFACE create vlan $VLAN vlandev $VLANDEV || exit
if [ -n "$IP" ]; then
	if [ "$IP" = "auto" ]; then
		dhclient $IFACE
	else
		ifconfig $IFACE inet $IP
	fi
fi
if [ -n "$IP6" ]; then
	if [ "$IP" = "auto" ]; then
		ifconfig $IFACE accept_rtadv
	else
		ifconfig $IFACE inet6 $IP6
	fi
fi
ifconfig $IFACE $OPTS up

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>