From this documentation provided by SmartOS http://wiki.smartos.org/display/DOC/Administering+the+Global+Zone

We can enable DHCP client on global zone by create a SMF service which start will dhcp client on network interface at start up.

Create SMF Service

/opt/custom/smf/setup_service.xml

Create SMF service manifest xml file under /opt/custom/smf (SmartOS SMF will automatically detect and run it at startup) This script will wait for two dependency to start up first before it runs (network and filesystem)

<?xml version=’1.0′?>
<!DOCTYPE service_bundle SYSTEM ‘/usr/share/lib/xml/dtd/service_bundle.dtd.1′>
<service_bundle type=’manifest’ name=’export’>
<service name=’smartos/setup’ type=’service’ version=’0′>
<create_default_instance enabled=’true’/>
<single_instance/>
<dependency name=’net-physical’ grouping=’require_all’ restart_on=’none’ type=’service’>
<service_fmri value=’svc:/network/physical’/>
</dependency>
<dependency name=’filesystem’ grouping=’require_all’ restart_on=’none’ type=’service’>
<service_fmri value=’svc:/system/filesystem/local’/>
</dependency>
<exec_method name=’start’ type=’method’ exec=’/opt/custom/scripts/setup.sh %m’ timeout_seconds=’0’/>
<exec_method name=’stop’ type=’method’ exec=’/opt/custom/scripts/setup.sh %m’ timeout_seconds=’0’/>
<property_group name=’startd’ type=’framework’>
<propval name=’duration’ type=’astring’ value=’transient’/>
</property_group>
<stability value=’Unstable’/>
<template>
<common_name>
<loctext xml:lang=’C’>SmartOS Ad Hoc Setup Script</loctext>
</common_name>
</template>
</service>
</service_bundle>

Create setup script

/opt/custom/scripts/setup.sh

this setup scripts will set hostname and use ipadm (ifconfig replacement) to create an interface and set dhcp on it.

#!/bin/bash
# Simple Ad Hoc SmartOS Setup Service
#enable debug
set -o xtrace
PATH=/usr/sbin:/usr/bin:/opt/custom/bin:/opt/custom/sbin; export PATH

if [ $1 == “start” ]
hostname “smartos01” && hostname > /etc/nodename
ipadm create-if e1000g0
ipadm create-addr -T dhcp e1000g0/dhcp
fi
exit 0

Done!