Tuesday, April 10, 2018

ADD IP to Solaris 11

Step 1 : Set the NCP

To check the current NCP setting:
# netadm list
TYPE        PROFILE        STATE
ncp         Automatic      disabled
ncp         DefaultFixed   online
loc         Automatic      offline
loc         NoNet          offline
loc         DefaultFixed   online
As seen in the output above, the NCP is set to DefaultFixed. In case it is not set, use netadm command to set it to DefaultFixed :
# netadm enable -p ncp DefaultFixed
Step 2 : Check the link status
The command to check the link status in Solaris 11 is :
# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      e1000g0
 Step 3 : Create a new interface
The ipadm command creates the new interface to be configured :
# ipadm create-ip net0
Check the newly created interface :
# ipadm show-if
IFNAME     CLASS      STATE      ACTIVE      OVER
lo0        loopback   ok         yes         ---
net0       ip         down       no          ---
Step 4 : Creating IP address

-T specifies either static, dhcp or addrconf (for IPv6) types of addresses.
# ipadm create-addr –T static –a local=192.168.1.10/24 net0/techh
To check the interface status of the interface :
# ipadm show-if
IFNAME     CLASS    STATE    ACTIVE OVER
lo0        loopback ok       yes    --
net0       ip       ok       yes    --
To check the configured IP address :
# ipadm show-addr
ADDROBJ                TYPE     STATE        ADDR
lo0/v4                 static   ok           127.0.0.1/8
net0/geeklab           static   ok           192.168.1.20/24
lo0/v6                 static   ok           ::1/128

delete the interface

 
# ipadm delete-ip net0