Software >> OS >> Unix >> Solaris >> 11 >> Networking >> Examples of networking commands - dladm ipadm netadm netcfg and route

 

Overview

  • dladm - configure data links
  • ipadm - configure ip interfaces and ip addresses
  • netadm - to enable and disable profiles and display information about profiles and their states
  • netcfg - create and modify network configuration profiles
  • route - manipulate network routing tables

 

dladm


## Show link configuration for all links

# dladm show-link
LINK                CLASS     MTU    STATE    OVER
net1                phys      1500   up       --
net2                phys      1500   up       --
net0                phys      1500   up       --
net3                phys      1500   up       --


## show link configuration for specific link

# dladm show-link net1
LINK                CLASS     MTU    STATE    OVER
net1                phys      1500   up       --


## rename a link

# dladm rename-link net3 net9


## show all physical device and their attributes

# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net1              Ethernet             up         10000  full      vmxnet3s1
net2              Ethernet             up         10000  full      vmxnet3s2
net0              Ethernet             up         10000  full      vmxnet3s0



## show all physical devices and their locations

# dladm show-phys -L
LINK              DEVICE       LOC
net0              vmxnet3s0    MB
net1              vmxnet3s1    MB
net2              vmxnet3s2    MB
net3              vmxnet3s4    MB


## show state information for all or specified physical ethernet links

# dladm show-ether
LINK              PTYPE    STATE    AUTO  SPEED-DUPLEX                    PAUSE
net1              current  up       no    10G-f                           none
net2              current  up       no    10G-f                           none
net0              current  up       no    10G-f                           none
net3              current  up       no    0M                              none


## show extended state information for all or specified physical ethernet links.  shows
## current, capable, adv and peeradv

# dladm show-ether -x
LINK              PTYPE    STATE    AUTO  SPEED-DUPLEX                    PAUSE
net1              current  up       no    10G-f                           none
--                capable  --       no    --                              none
--                adv      --       no    --                              none
--                peeradv  --       no    --                              none
net2              current  up       no    10G-f                           none
--                capable  --       no    --                              none
--                adv      --       no    --                              none
--                peeradv  --       no    --                              none
net0              current  up       no    10G-f                           none
--                capable  --       no    --                              none
--                adv      --       no    --                              none
--                peeradv  --       no    --                              none
net3              current  up       no    0M                              none
--                capable  --       no    --                              none
--                adv      --       no    --                              none
--                peeradv  --       no    --                              none



 

 

ipadm


## create ip interface

ipadm create-ip net3


## create static ip address

ipadm create-addr -T static -a 192.168.1.106/24 net3/v4


## create dynamic ip address

ipadm create-addr -T dhcp net3/v4

 

 

 

netadm

 

 

 

netcfg

 

 

 

route