Strategies for Network Administration in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

Network Administration Command Cheatsheet

The following command reference describes how to perform common network administration tasks in the Oracle Solaris release. For more information about these commands, see the dladm (1M) , ipadm (1M) , and route (1M) man pages.


Note -  The various parameters that are specified in the following tasks are provided as examples only. The parameters that you specify will most likely vary from those that are used in this quick reference.
List all of the profiles on a system:
netadm list
Switch to the fixed mode by enabling the DefaultFixed profile:
# netadm enable -p ncp DefaultFixed
Display all of the datalinks (physical and virtual) on a system:
# dladm show-link
Display all of the physical datalinks on a system:
# dladm show-phys
Display all of the properties for all of the datalinks on a system:
# dladm show-linkprop
Display all of the properties for a specific datalink on a system:
# dladm show-linkprop net0
Display a specific property for a specific datalink on a system:
# dladm show-linkprop -p mtu net0
Modify a property of a specific datalink on a system, for example the MTU value:
# dladm set-linkprop -p mtu=1500 net0
Reset the default value for the property of a specific datalink on a system:
# dladm reset-linkprop -p mtu net0
Display general information about a system's interfaces:
# ipadm

The output of this command is comparable using the ifconfig command to obtain similar information.

Display a system's IP interfaces and addresses, including the netmask if set:
# ipadm show-addr
Create an IP interface and then configure a static IPv4 address for that interface:
# ipadm create-ip net0
# ipadm create-addr -a local=10.9.8.7/24 net0/addr
Obtain an IP address from a DHCP server:
# ipadm create-ip net0
# ipadm create-addr -T dhcp net0/addr
Create an auto-generated IPv6 address:
# ipadm create-ip net0
# ipadm create-addr -T addrconf net0/addr
Change the netmask property for an IP address object name (net3/v4) to 8:
# ipadm set-addrprop -p prefixlen=8 net3/v4
Configure a persistent default route for a system:
# route -p add default 192.168.1.1
Configure a static route for a system:
# route -p add -net 192.168.3.0 -gateway 192.168.1.1
Configure a system's host name (myhost):
# hostname myhost
Configure DNS on a system:
# svccfg -s dns/client setprop config/nameserver=net_address: 192.168.1.1
# svccfg -s dns/client setprop config/domain = astring: "myhost.org"
# svccfg -s name-service/switch setprop config/host = astring: "files dns"
# svcadm refresh name-service/switch
# svcadm refresh dns/client