mirror of
https://github.com/CloudNebulaProject/zmgr.git
synced 2026-04-10 13:10:42 +00:00
30 lines
467 B
Bash
30 lines
467 B
Bash
|
|
#!/usr/bin/bash
|
||
|
|
set -ex
|
||
|
|
|
||
|
|
ZONE=$1
|
||
|
|
ADDRESS="${2}/24"
|
||
|
|
NICNAME="${ZONE}0"
|
||
|
|
INTERNALSTUB="oflint0"
|
||
|
|
GATEWAY="192.168.10.1"
|
||
|
|
|
||
|
|
if ! dladm show-vnic $NICNAME > /dev/null; then
|
||
|
|
dladm create-vnic -l $INTERNALSTUB $NICNAME
|
||
|
|
fi
|
||
|
|
|
||
|
|
cat <<EOF | zonecfg -z $ZONE
|
||
|
|
create -b
|
||
|
|
set zonepath=/zones/$ZONE
|
||
|
|
set brand=nlipkg
|
||
|
|
set autoboot=true
|
||
|
|
set ip-type=exclusive
|
||
|
|
add net
|
||
|
|
set physical=$NICNAME
|
||
|
|
set allowed-address=$ADDRESS
|
||
|
|
set defrouter=$GATEWAY
|
||
|
|
end
|
||
|
|
verify
|
||
|
|
commit
|
||
|
|
EOF
|
||
|
|
|
||
|
|
zoneadm -z $ZONE install
|