Software >> OS >> Unix >> Solaris >> 11 >> Cheatsheets >> Network administration commands - netadm, dladm, ipadm, etc

Oracle® Solaris 11.3 Network Administration Cheatsheet

 

Commonly Used Network Administration Commands

 

Action
Command

Administering Profiles

List all of the network profiles on a system.
# netadm list
Switch to the fixed mode by enabling the DefaultFixed profile.
# netadm enable -p ncp DefaultFixed

Administering Datalinks

Display all the datalinks (physical and virtual) on a system.
# dladm show-link
Display all the physical datalinks on a system.
# dladm show-phys
Display all the properties for all the datalinks on a system.
# dladm show-linkprop
Display all 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

Administering IP Interfaces and Addresses

Display general information about a system's IP interfaces.
# ipadm
Display a system's IP interfaces and addresses.
# ipadm show-addr
Create an IP interface and then configure a static IPv4 address for that interface.
# ipadm create-ip net0
# ipadm create-addr -T static -a 10.9.8.7/24 net0/v4
Obtain an IP address from a DHCP server.
# ipadm create-ip net0
# ipadm create-addr -T dhcp net0/v4
Create an auto-generated IPv6 address.
# ipadm create-ip net0
# ipadm create-addr -T addrconf net0/v4
Change the netmask 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 persistent default route by specifying a name.
# route -p add 9.9.9.9 3.3.3.9 -name route1
persistent: route add 9.9.9.9 3.3.3.9 -name route1
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.
# hostname hostname
Set a system's domain name.
# domainname name-of-domain

Administering Naming Services

Configure DNS for 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
# svcadm enable dns/client

Commonly Used IP Administration Commands

Action
Command

Administering TCP

Display TCP protocol properties.
# ipadm show-prop tcp
Assign values to protocol properties.
# ipadm set-prop [-t] -p property=value[,...] protocol
Remove one value from a set of values for a given property.
# ipadm set-prop -p property-=value2
Reset a specific protocol property to its default value.
# ipadm reset-prop -p property protocol
Enable packet forwarding for all IPv4 traffic on a system.
# ipadm set-prop -p forwarding=on ipv4
Enable packet forwarding for all IPv6 traffic on a system.
# ipadm set-prop -p forwarding=on ipv6
Display the lowest port number for a non-privileged port.
# ipadm show-prop -p smallest-nonpriv-port tcp
Add a port to the extra privileged ports.
# ipadm set-prop -p extra-priv-ports+=3001 tcp
Remove a privileged port.
# ipadm set-prop -p extra-priv-ports-=4045 tcp
Display the ECN property.
# ipadm show-prop -p ecn tcp
Add an algorithm for congestion control in the TCP protocol.
# ipadm set-prop -p cong-enabled+=algorithm tcp
Remove an algorithm for congestion control in the TCP protocol.
# ipadm set-prop -p cong-enabled-=algorithm tcp
Replace the default algorithm for congestion control in the TCP protocol.
# ipadm set-prop -p cong-default=algorithm tcp
Display the algorithm currently used by UDP sockets.
# ipadm show-prop -p reuseport-lbalg udp
Set the value of the TCP receive buffer size.
# ipadm set-prop -p recv-buf=value tcp
Display information about IP interfaces in a system.
# ipadm show-if
Display information about IP interfaces and addresses in a system.
# ipadm show-addr
Administering IPMP Interfaces
Create an IPMP interface.
# ipadm create-ipmp ipmp-interface
Create an underlying IP interface that can be added to the IPMP interface.
# ipadm create-ip under-interface
Add the underlying IP interfaces to the IPMP interface.
# ipadm add-ipmp -i under-interface1 [-i under-interface2 ...] ipmp-interface
Set DHCP to manage and configure the data address for the IPMP interface.
# ipadm create-addr -T dhcp ipmp-interface
Set DHCP to manage the test addresses of the underlying interfaces in an IPMP group for probe-based failure detection.
# ipadm create-addr -T dhcp under-interface
Set one of the underlying interface as a standby interface.
# ipadm set-ifprop -p standby=on -m ip under-interface
Remove the data address from an IP interface.
# ipadm delete-addr addrobj
Remove one or more interfaces from an IPMP group.
# ipadm remove-ipmp -i under-interface[ -i under-interface ...] ipmp-interface
Display the list of data addresses.
# ipadm show-addr ipmp-interface
Display the list of test addresses.
# ipadm show-addr
Move an interface to a different IPMP group.
# ipadm add-ipmp -i under-interface ipmp-interface
Remove the IP interfaces from an IPMP group.
# ipadm add-ipmp -i under-interface ipmp-interface
Remove an IPMP interface.
# ipadm delete-ipmp ipmp-interface

Administering IP Tunnel Interfaces

Create an IP interface over an IP tunnel.
# ipadm create-ip tunnel-interface
Assign local and remote IP addresses to a tunnel interface.
# ipadm create-addr [-t] -a local=address,remote=address interface
Unplumb the IP interface that is configured over the tunnel.
# ipadm delete-ip tunnel-link

Commonly Used Datalink Administration Commands

Component
Action
Syntax
Example

Administering Virtual Networks

 
VNIC
Create
dladm create-vnic [-t] [-f] -l link [-R root-dir] [-m value | auto | {factory [-n slot-identifier]} | {vrrp -A {inet | inet6} -V vrid} | {random [-r prefix]}] [-v vlan-id[,pvlan-svid[,pvlan-type]]] [-P pkey] [-p prop=value[,...]] vnic-link
# dladm create-vnic -l net0 vnic1
# dladm create-vnic -l net0 -m factory -n 1 hello0
where –n specifies the a factory MAC address slot to be used.
# dladm create-vnic -m vrrp -V 21 -A inet6 -l net0 vnic0
where –A specifies the address family and –V specifies the virtual router ID (VRID) for assigning a virtual MAC address to the VRRP VNIC.
Display
dladm show-vnic [–P | {–z zone[,..]}] [[–p] –o field[,..]] [–l link] [vnic-link]
# dladm show-vnic
Modify
dladm modify-vnic [–t] [–R root-dir] –l link] [–m value | auto | {factory [–n slot-identifier]} | {vrrp –A {inet | inet6} –V vrid} | {random [–r prefix]}] [–v vlan-id] {vnic-link,[vnic-link ,...] | –L source-link}
# dladm modify-vnic -l net1 -m 2:8:20:00:01:02 vnic0
where –m specifies the VNIC's MAC address based on the specified value or keyword.
# dladm modify-vnic -l net1 -L net0
where –l specifies the datalink to which the VNICs need to be moved and –L specifies the source datalink.
Delete
dladm delete-vnic [-t] [-R root-dir] vnic-link
# dladm delete-vnic vnic0
VLAN VNIC
Create
dladm create-vnic -v vlan-id -l link vnic-link
# dladm create-vnic -v 101 -l net0 vnic1
Modify
dladm modify-vnic -v vlan-id -L source-link
# dladm modify-vnic -v 123 -L net0
PVLAN VNIC
Create
dladm create-vnic -v vlan-id,pvlan-svid,pvlan-type -l link vnic-link
# dladm create-vnic -v 4,110,community -l net1 vnic2
VF VNIC
Create
dladm create-vnic -p iov=value -l link vfvnic-link
# dladm create-vnic -p iov=on -l net0 vfvnic1
IPoIB VNIC
Create
dladm create-vnic -l link -P pkey vnic-link
# dladm create-vnic -l net4 -P 0xffff ipoib_vnic0
Etherstub
Create
dladm create-etherstub [–t] [–R root-dir] etherstub
# dladm create-etherstub etherstub0 
Display
dladm show-etherstub [–Z] [–z zone[,...]] [etherstub ]
# dladm show-etherstub
Delete
dladm delete-etherstub [– t] [–R root-dir] etherstub
# dladm delete-etherstub etherstub0
VXLAN
Create
dladm create-vxlan [–t] [–R root-dir] –p vni=vxlan id,addr=ip_address [,prop=value[,...] ] vxlan-link
# dladm create-vxlan -p addr=10.10.11.1,vni=10 vxlan1
Display
dladm show-vxlan [–P] [[–p] –o field[,...]] [vxlan-link]
# dladm show-vxlan
Delete
dladm delete-vxlan [-t] [-R root-dir] vxlan-link
# dladm delete-vxlan vxlan1

Administering Aggregations

 
Trunk aggregation
Create
dladm create-aggr [-t] [ -R root-dir] -m mode] [-P policy] [ -L lacpmode] [-T time] [-u address] -l link1 [ -l link2...] aggr-link
# dladm create-aggr -m trunk -L LACP-mode -l net0 -l net1 aggr0
Add links
dladm add-aggr -l link1 [-l link2...] aggr-link
# dladm add-aggr -l net3 aggr0
Remove a link
dladm remove-aggr -l link aggr-link
# dladm remove-aggr -l net3 aggr0
Modify
dladm modify-aggr [–t] [–R root-dir] [–m mode] [–P policy] [–L lacpmode] [–T time] [–u address] aggr-link
# dladm modify-aggr -L active -T short aggr0
Display
dladm show-aggr [–PLxZSCv] [[–p] –o field[,...]] [–z zone[,...]] [aggr-link]
# dladm show-aggr
Delete
dladm delete-aggr [-t] [-R root-dir] aggr-link
# dladm delete-aggr aggr0
DLMP aggregation
Create
dladm create-aggr -m dlmp -l link1 [-l link2...] aggr-link
# dladm create-aggr -m dlmp -l net0 -l net1 -l net2 aggr0
Configure probe-based failure detection
dladm set-linkprop -p probe-ip=+ aggr
dladm set-linkprop -p probe-ip=[source[,...]]+[target[,...]] aggr
# dladm set-linkprop -p probe-ip=+ aggr1

Administering VLANs

VLAN
Create
dladm create-vlan [-ft] [-R root-dir] -l ether-link -v vid[,pvlan-svid[,pvlan-type]] [vlan-link]
# dladm create-vlan -l net0 -v 123 tech0
Display
dladm show-vlan [–PZ] [[–p] –o field[,...]] [–z zone[,...]] [vlan-link ]
# dladm show-vlan
Modify
dladm modify-vlan [–t] [–R root-dir] [–l ether-link] [–v vid[,pvlan-svid[,pvlan-type]] [–f]] {vlan-link,[vlan-link,...] | –L source-ether-link}
# dladm modify-vlan -v 123 web1
# dladm modify-vlan -l net1 -L net4
# dladm modify-vlan -l net3 vlan1,vlan2,vlan3
Delete
dladm delete-vlan vlan-link
# dladm delete-vlan vlan1
PVLAN
Create
dladm create-vlan -v vlan-id,pvlan-svid,[pvlan-type] [vlan-link]
# dladm create-vlan -v 3,100,isolated -l net0 vlan1
# dladm create-vlan -v 3,100 -l net0 vlan1
Modify
dladm modify-vlan [–t] [–R root-dir] –v vid,pvlan-svid[,pvlan-type] vlan-link
# dladm modify-vlan -v 15,103,community vlan1

Administering Bridges

 
Bridge
Create
dladm create-bridge [ –P protect] [–R root-dir] [ –p priority] [ –m max-age] [ –h hello-time] [ –d forward-delay] [ –f force-protocol] [–l link...] bridge-name
# dladm create-bridge -P stp -d 12 -l net0 -l net1 brooklyn
Add links
dladm add-bridge [-R root-dir] -l link [-l link...]bridge-name
# dladm add-bridge -l net2 brooklyn
Modify
dladm modify-bridge [ –P protect] [–R root-dir] [ –p priority] [ –m max-age] [ –h hello-time] [ –d forward-delay] [ –f force-protocol] [–l link...]
# dladm modify-bridge -P stp brooklyn
Display
dladm show-bridge [–flt] [–s [–i interval]] [[–p] –o field,...] [bridge-name]
# dladm show-bridge
Remove links
dladm remove-bridge [–R root-dir] –l link [– l link...] bridge-name
# dladm remove-bridge -l net0 -l net1 -l net2 charles
Delete Bridge
dladm delete-bridge [–R root-dir] bridge-name
# dladm delete-bridge coronado

Setting Link Properties

Link Properties
Set
dladm set-linkprop [–t] [–R root-dir] –p prop=value[,...] link
# dladm set-linkprop -p bwshare=40 vnic1
# dladm set-linkprop -p iov=on net0
Reset
dladm reset-linkprop [–t] [–R root-dir] [–p prop,...] link
# dladm reset-linkprop -p stp_priority brooklyn
# dladm reset-linkprop -p protection vnic0
Display
dladm show-linkprop [–HPZ] [[–c] –o field[,...]][– p prop[,...]] [–z zone[,...]] [link]
# dladm show-linkprop -p etsbw-lcl,etsbw-rmt,etsbw-lcl-advice vnic1

Administering Physical Links

Physical links
Display
dladm show-phys [-PZ] [-Lmv] [[-p] -o field[,...]] [-H] [-z zone[,...]] [[-D [dcb-feature]] [-lr]] [-G] [phys-link]
# dladm show-phys -m net0
where –m specifies the list of factory MAC addresses, their slot identifiers, and their availability.
# dladm show-phys -o LINK,VFS-INUSE
Delete
dladm delete-phys phys-link
# dladm delete-phys mgmt0