Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SMF Manifest to bring up IPv6 on SmartOS
Need to open /usbkey/config and add
admin_v6_ip=xx:xx:xx/xx
admin_v6_gateway=yy:yy:yy
place ipv6 in /opt/custom/smf
place ipv6.xml in /opt/custom/scripts
#!/bin/bash
. /lib/svc/share/smf_include.sh
. /lib/sdc/config.sh
load_sdc_sysinfo
load_sdc_config
ifconfig ${SYSINFO_NIC_admin} inet6 plumb up
if [[ -n "${CONFIG_admin_v6_ip}" ]] && [[ -n "${CONFIG_admin_v6_gateway}" ]]; then
ifconfig ${SYSINFO_NIC_admin} inet6 addif ${CONFIG_admin_v6_ip} up
route add -inet6 ${CONFIG_admin_v6_gateway} ${CONFIG_admin_v6_ip} -interface
route add -inet6 default ${CONFIG_admin_v6_gateway}
fi
exit $SMF_EXIT_OK
<?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="site/ipv6" type="service" version="0">
<create_default_instance enabled="true"/>
<single_instance/>
<dependency name="network" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/milestone/network:default"/>
</dependency>
<dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/system/filesystem/local"/>
</dependency>
<method_context/>
<exec_method name="start" type="method" exec="/opt/custom/scripts/ipv6" timeout_seconds="60"/>
<exec_method name="stop" type="method" exec=":kill" timeout_seconds="60"/>
<property_group name="startd" type="framework">
<propval name="duration" type="astring" value="transient"/>
<propval name="ignore_error" type="astring" value="core,signal"/>
</property_group>
<property_group name="application" type="application"/>
<stability value="Evolving"/>
<template>
<common_name>
<loctext xml:lang="C">Create an IPv6 vnic, bind to admin and bring up for global zone</loctext>
</common_name>
</template>
</service>
</service_bundle>
@badboy

This comment has been minimized.

Copy link

commented Dec 3, 2012

Took me sometime to figure this out.To actually enable IPv6:

cd /opt/custom/smf
svccfg validate ipv6.xml 
svccfg import ipv6.xml 
svcadm enable site/ipv6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.