OpenSolaris

You are not signed in. Sign in or register.
Version 1.0.1, 2007-Mar-05

There is a single CLI, nwamcfg(1m), which serves for both configuration and administration. It borrows much from zonecfg(1m): the concepts of scope, the terms resources and properties, and much of the syntax is similar. Here is a sample session:

# nwamcfg
nwamcfg> create env
nwamcfg:env> set name=swan
nwamcfg:env> add profile
Enter nodename: laptop
Enter nfs_domain: sun.com
Enter dns_domain: sun.com
Enter ns file: /etc/nsswitch.dns
Enter proxy file: swan.pac
Enter ipf file: /etc/ipf/ipf.conf
Enter ipsec file: 
Enter smf_svc file: smf_svc_info
End of walk.
nwamcfg:env> add condition ip_address in 129.144/12
nwamcfg:env> set priority=1
nwamcfg:env> end
nwamcfg> activate env home
nwamcfg> select ncp main
nwamcfg:ncp> insert ncu
nwamcfg:ncp:ncu> set type=link
nwamcfg:ncp:ncu> set name=bge0
nwamcfg:ncp:ncu> end
nwamcfg:ncp> end
nwamcfg> exit
#
Here is a syntax breakdown; commands valid in all scopes:
  • exit
  • help
  • info
global scope:
  • create resource
  • select resource name
  • destroy resource name
  • activate resource name
  • commit
  • export
  • import
valid one-level resources:
  • env
valid two-level resources:
  • ncp
one-level resource scope:
  • walk
  • set simple-property=value
  • add list-property value
  • end
two-level resource scope:
  • insert sub-resource
  • select sub-resource name
  • delete sub-resource name
  • set simple-property=value
  • add list-property value
  • end
valid sub-resources for ncp:
  • ncu

properties for various resources
resource simple properties list properties
env   profile, priority, condition
all NCUs type, class, name, activation, over, under contingency
link-type NCUs devname, linkid, macaddr, macaddr_mode, mtu autopush
link/phys NCUs speed, duplex, jumbo  
link/vlan NCUs vid  
link/aggr NCUs key, nports, lacp_mode, lacp_timer ports
link/iptun NCUs tunnel_type, tsrc, tdst, encr_alg, encr_auth_alg, auth_alg  
ip NCUs version, addr, timeout (if dhcp), fallback_addr (if dhcp) addrsrc
ip/ipmp NCUs v4_test_addr  

property details:

  • most value entries are simple strings; two special cases below
    • value := string
  • special case 1: condition
    • condition := simple-condition | ["("] condition bop condition [")"]
    • bop := "and" | "or"
    • simple-condition := tag operator operand
    • tag := "ip_address" | "domain_name" | "essid" | "bssid"
    • operator := "==" | "!=" | "in" | "range" | "begins" | "ends" | "contains" | "!contains"
    • operand := IP address ["/" prefix-length] | string
    • special case when operator is "range":
    • operand := IP address "-" IP address
  • special case 2: contingent
    • contingent := cop ncu-name
    • cop := "require" | "optional" | "exclude"
    • ncu-name := string