File:  [ELWIX - Embedded LightWeight unIX -] / elwix / config / etc / uboot / rc.d / 013.vlan0.stop
Revision 1.2.2.2: download - view: text, annotated - select for diffs - revision graph
Thu Mar 5 23:23:09 2015 UTC (9 years, 4 months ago) by misho
Branches: elwix2_3
Diff to: branchpoint 1.2: preferred, unified
adds aliases support

    1: #!/bin/sh
    2: 
    3: IFACE="vlan0"
    4: 
    5: VLAN="1"
    6: VLANDEV="em0"
    7: 
    8: OPTS=""
    9: #IP="auto"
   10: IP="192.168.0.1/24"
   11: ALIASES=""
   12: #IP6="auto"
   13: IP6=""
   14: ALIASES6=""
   15: 
   16: [ -z "$IFACE" -o -z "$VLANDEV" ] && exit
   17: 
   18: echo "Config VLAN #$VLAN network interface $IFACE ..."
   19: 
   20: ifconfig $IFACE create vlan $VLAN vlandev $VLANDEV || exit
   21: if [ -n "$IP" ]; then
   22: 	if [ "$IP" = "auto" ]; then
   23: 		dhclient $IFACE
   24: 	else
   25: 		ifconfig $IFACE inet $IP
   26: 	fi
   27: fi
   28: for i in $ALIASES; do
   29: 	ifconfig $IFACE inet alias $i
   30: done
   31: if [ -n "$IP6" ]; then
   32: 	if [ "$IP" = "auto" ]; then
   33: 		ifconfig $IFACE accept_rtadv
   34: 	else
   35: 		ifconfig $IFACE inet6 $IP6
   36: 	fi
   37: fi
   38: for i in $ALIASES6; do
   39: 	ifconfig $IFACE inet6 alias $i
   40: done
   41: ifconfig $IFACE $OPTS up

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