version 1.1.1.1, 2011/07/05 23:43:00
|
version 1.1.1.1.22.1, 2015/03/05 22:58:33
|
Line 3
|
Line 3
|
IFACE="vlan0" |
IFACE="vlan0" |
|
|
VLAN="1" |
VLAN="1" |
VLANDEV="fxp0" | VLANDEV="em0" |
|
|
OPT="" | OPTS="" |
| #IP="auto" |
IP="192.168.0.1/24" |
IP="192.168.0.1/24" |
|
#IP6="auto" |
|
IP6="" |
|
|
echo "Config VLAN network interface $IFACE ..." | [ -z "$IFACE" -o -z "$VLANDEV" ] && exit |
ifconfig $IFACE create vlan ${VLAN} vlandev ${VLANDEV} | |
ifconfig $IFACE inet $IP ${OPT} up | 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 |