Solaris Express - Static IPs the Right Way

Tags: Solaris

If you search the Internet, you'll likely strike dozens of articles describing how to set static IPs on Solaris Express by disabling NWAM (NetWork AutoMagic) and enabling the legacy physical interface service. I've been building a Solaris Express server to be some clustered storage for a test environment, and no matter what I did, NWAM would be enabled after a reboot, and I'd have no connectivity. I have a better suggestion; Don't do that, do it properly.

Instead, run up the nwamcfg utility and configure your interfaces as your very own Network Configuration Profile (ncp) there. You'll need a physical interface definition (controls your packet sizes, interface speeds etc) and an ip interface definition (controls IPv4/IPv6, IP address, subnet mask and gateway).

The nwam toolset lets you configure almost any reasonable environment. When you create an object, you get a chance to walk through what amounts to a text-mode wizard to set properties for the object - unless otherwise noted in bold, the example here accepts the default option for each property - the one listed in the round brackets. With that in mind,  Let's configure a machine with a single Intel Pro/1000 CT interface:

# nwamcfg
nwamcfg> create ncp CorpNet
nwamcfg:ncp:CorpNet> create ncu phys e1000g0
Created ncu 'e1000g0'.  Walking properties ...
activation-mode (manual) [manual|prioritized]> prioritized
enabled (true) [true|false]>
priority-group> 0
priority-mode [exclusive|shared|all]> shared
link-mac-addr>
link-autopush>
link-mtu>
nwamcfg:ncp:CorpNet:ncu:e1000g0> end
Committed changes
nwamcfg:ncp:CorpNet> create ncu ip e1000g0
Created ncu 'e1000g0'.  Walking properties ...
enabled (true) [true|false]>
ip-version (ipv4,ipv6) [ipv4|ipv6]>
ipv4-addrsrc (dhcp) [dhcp|static]> static
ipv4-addr> 10.0.1.2
ipv4-default-route> 10.0.1.1
ipv6-addrsrc (dhcp,autoconf) [dhcp|autoconf|static]> dhcp,autoconf,static
ipv6-addr> fd27:c503:709b:9d46::11:a4d4
ipv6-default-route>
fd27:c503:709b:9d46::11:1
nwamcfg:ncp:CorpNet:ncu:e1000g0> end
Committed changes
nwamcfg:ncp:CorpNet> end

Then activate the User NCP using nwamadm - and hey presto, your IP configuration is set:

# nwamadm enable -p ncp CorpNet
Enabling ncp 'CorpNet'

As a bonus - you can easily disable IPv6 by setting the "ip-version" property to "ipv4". Or enable only IPv6, if that's your preference. nwamcfg will only ask questions that make sense (so you might see different prompts if you're building a different configuration). If you don't configure an interface with nwam, it stays down.

Total time to configure a simple network with static IPs? About 30 seconds, once you're used to it (and yes, it's all scriptable, naturally).

My iSCSI interfaces are now IPv4 only with 9K jumbo frames enabled. My NAS interface is a Link Aggregation (LACP) of two NICs, using dladm to create/manage, and static IPv4 and IPv6 addresses. And it all starts up with the right configuration. Finally.

Further Reading

  1. Manual page for nwamcfg - http://download.oracle.com/docs/cd/E19963-01/html/821-1462/nwamcfg-1m.html
  2. Manual page for nwamadm - http://download.oracle.com/docs/cd/E19963-01/html/821-1462/nwamadm-1m.html
  3. NWAM Configuration and Administration (Overview) - http://download.oracle.com/docs/cd/E19963-01/html/821-1458/giyfo.html#scrolltoc
  4. NWAM Configuration Tasks - http://download.oracle.com/docs/cd/E19963-01/html/821-1458/giwtf.html#scrolltoc

Things You DON'T Want To Do

  1. Disable the nwam service - svcs disable svc:/network/physical:nwam
  2. Enable the network physical service - svcs enable svc:/network/physical:default

No Comments