Sunday, 21 October 2018

How to configure Solaris 10 Probe based IPMP By Devan

How to configure Solaris 10 Probe based IPMP

What’s a Probe Based IPMP ?

The failure detection method used by the in.mpathd daemon differentiates the IPMP as probe based or link based. Probe based IPMP uses 2 types of addresses in its configuration.
1. Test address – Used by in.mpathd daemon for detecting the failure (also called as probe address).
2. Data Address – Used by applications for actual data transfer.
In case of probe based IPMP :
– in.mpathd daemon sends out ICMP probe messages on test address to one or more target systems on the same subnet.
– in.mpathd daemon determines the available target systems to probe dynamically. It uses a “all hosts” multicast (224.0.0.1) address to determine the target systems to probe.
examples of target systems :
1. all default routes on same subnet.
2. all host routes on same subnet. (configured with “route -p add” command)

– All test addresses should be in the same subnet.

mpathd Configuration file

mpathd daemon is responsible to detect an interface failure . It uses a configuration file /etc/default/mpathd to set various IPMP parameters.
# cat /etc/default/mpathd
#
#pragma ident   "@(#)mpathd.dfl 1.2     00/07/17 SMI"
#
# Time taken by mpathd to detect a NIC failure in ms. The minimum time
# that can be specified is 100 ms.
#
FAILURE_DETECTION_TIME=10000
#
# Failback is enabled by default. To disable failback turn off this option
#
FAILBACK=yes
#
# By default only interfaces configured as part of multipathing groups
# are tracked. Turn off this option to track all network interfaces
# on the system
#
TRACK_INTERFACES_ONLY_WITH_GROUPS=yes
The important parameters in mpathd configuration file are :
1. FAILURE_DETECTION_TIME : Time taken by mpathd to detect a NIC failure in ms (default value – 10 seconds)
2. FAILBACK : To enable or disable failback after the failed link becomes available (default vaule – yes)
3. TRACK_INTERFACES_ONLY_WITH_GROUPS – If turned on interfaces configured as part of IPMP are only monitored (default vaule – yes)
The command for in.mpathd daemon to re-read the configuration file is :
# pkill -HUP in.mpathd

Failure detection and repair detection time

– The probing rate depends on the FAILURE_DETECTION_TIME set in the /etc/default/mpathd configuration file (default value 10 seconds).
– in.mpathd send 5 probes in every 10 seconds ( or the FAILURE_DETECTION_TIME set ). If 5 consecutive probes fail, in.mpathd considers the interface to be failed.
– The minimum repair detection time is twice the failure detection time. So if the failure detection time is 10 seconds, then the repaire detection time would be 20 seconds (with 10 probes).

Testing IPMP failover

We can check the failure and repair of an interface very easily using if_mpadm command. “-d” detaches the interface whereas “-r” reattaches it.
# if_mpadm -d ce0
# if_mpadm -r ce0

Meanings of FLAGs

You would see flags such as NOFAILOVER, DEPRECATED, STANDBY etc.. in the output of “ifconfig -a” command. The meanings of these flags and parameters to enable them are:
deprecated -> can only be used as test address for IPMP and not for any actual data transfer by applications.
-failover -> does not failover when the interface fails
standby -> makes the interface to be used as standby

Most commonly used Probe-Based IPMP configurations

1. Active – Active configuration
Groupname:             ipmp0
Active interface(s):   e1000g0 
                       e1000g1
Standby interface(s):  -
Data IP addresse(s):   192.168.1.2
Test IP addresse(s):   192.168.1.3
                       192.168.1.4
Command line :
# ifconfig e1000g0 plumb 192.168.1.2 netmask + broadcast + group ipmp0 up addif 192.168.1.3 netmask + broadcast + deprecated -failover up
# ifconfig e1000g1 plumb 192.168.1.4 netmask + broadcast + deprecated -failover group ipmp0 up
To ensure persistent configuration across reboots edit the files :
/etc/hostname.e1000g0:
192.168.1.2 netmask + broadcast + group ipmp0 up 
addif 192.168.1.3 netmask + broadcast + deprecated -failover up

/etc/hostname.e1000g1:
192.168.1.4 netmask + broadcast + deprecated -failover group ipmp0 up
Before failure :
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4] mtu 1500 index 9
        inet 192.168.1.2 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:f6:ef:67
e1000g0:1: flags=9040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER] mtu 1500 index 9
        inet 192.168.1.3 netmask ffffff00 broadcast 192.168.1.255
e1000g1: flags=9040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER] mtu 1500 index 10
        inet 192.168.1.4 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:f6:ef:71
After failure :
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=19000802[BROADCAST,MULTICAST,IPv4,NOFAILOVER,FAILED] mtu 0 index 9
        inet 0.0.0.0 netmask 0
        groupname ipmp0
        ether 0:c:29:f6:ef:67
e1000g0:1: flags=19040803[UP,BROADCAST,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,FAILED] mtu 1500 index 9
        inet 192.168.1.3 netmask ffffff00 broadcast 192.168.1.255
e1000g1: flags=9040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER] mtu 1500 index 10
        inet 192.168.1.4 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:f6:ef:71
e1000g1:1: flags=1000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4] mtu 1500 index 10
        inet 192.168.1.2 netmask ffffff00 broadcast 192.168.1.255
2. Active – Standby
The only difference in case of a active-standby configuration is – the interface configured as standby is not used to send any out bound traffic. Thus disabling the load balancing feature of an active-active configuration.
Groupname:             ipmp0
Active interface(s):   e1000g0             
Standby interface(s):  e1000g1
Data IP addresse(s):   192.168.1.2
Test IP addresse(s):   192.168.1.3
                       192.168.1.4
Command line :
# ifconfig e1000g0 plumb 192.168.1.2 netmask + broadcast + group ipmp0 up addif 192.168.1.3 netmask + broadcast + deprecated -failover up
# ifconfig e1000g1 plumb 192.168.1.4 netmask + broadcast + deprecated -failover group ipmp0 standby up
To ensure persistent configuration across reboots edit the files :
/etc/hostname.e1000g0:
192.168.1.2 netmask + broadcast + group ipmp0 up 
addif 192.168.1.3 netmask + broadcast + deprecated -failover up

/etc/hostname.e1000g1:
192.168.1.4 netmask + broadcast + deprecated -failover group ipmp0 standby up
Before failure :
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4] mtu 1500 index 11
        inet 192.168.1.2 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:f6:ef:67
e1000g0:1: flags=9040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER] mtu 1500 index 11
        inet 192.168.1.3 netmask ffffff00 broadcast 192.168.1.255
e1000g1: flags=69040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,STANDBY,INACTIVE] mtu 1500 index 12
        inet 192.168.1.4 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:f6:ef:71
After failure :
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=19000802[BROADCAST,MULTICAST,IPv4,NOFAILOVER,FAILED] mtu 0 index 11
        inet 0.0.0.0 netmask 0
        groupname ipmp0
        ether 0:c:29:f6:ef:67
e1000g0:1: flags=19040803[UP,BROADCAST,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,FAILED] mtu 1500 index 11
        inet 192.168.1.3 netmask ffffff00 broadcast 192.168.1.255
e1000g1: flags=29040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,STANDBY] mtu 1500 index 12
        inet 192.168.1.4 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:f6:ef:71
e1000g1:1: flags=21000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4,STANDBY] mtu 1500 index 12
        inet 192.168.1.2 netmask ffffff00 broadcast 192.168.1.255

How to configure link based IPMP in Solaris 11 by Devan

How to configure link based IPMP in Solaris 11

Oracle made a tone of changes to its networking stack in Solaris 11. Persistent network configuration is now managed by SMF, and not by editing following files :
/etc/defaultdomain
/etc/dhcp.*
/etc/hostname.*
/etc/hostname.ip*.tun*
/etc/nodename
/etc/nsswitch.conf

IPMP conponents :

1. mpathd daemon – This daemon is responsible to detect an interface failure or repair. It uses a configuration file /etc/default/mpathd to determine when to failover the interface.
# cat /etc/default/mpathd
#
#pragma ident   "@(#)mpathd.dfl 1.2     00/07/17 SMI"
#
# Time taken by mpathd to detect a NIC failure in ms. The minimum time
# that can be specified is 100 ms.
#
FAILURE_DETECTION_TIME=10000
#
# Failback is enabled by default. To disable failback turn off this option
#
FAILBACK=yes
#
# By default only interfaces configured as part of multipathing groups
# are tracked. Turn off this option to track all network interfaces
# on the system
#
TRACK_INTERFACES_ONLY_WITH_GROUPS=yes
2. ipmpstat – Shows information about IP interface configured in an IPMP group also the test and data address.

Types of configurations

1. Singleton – IPMP group with single interface
2. Active-Active – All the interfaces in the IPMP group are online.
3. Active-standby – One of the interface in the IPMP configuration will be used as standby.

Testing IPMP failover

We can check the failure and repair of an interface very easily through command line. “-d” detaches the interface whereas “-r” reattaches it.
# if_mpadm -d ce0
# if_mpadm -r ce0

Prerequisites

1. IPMP requires a manual (fixed) network configuration mode, so we have to set the network configuration profile (NCP) to DefaultFixed.
# netadm enable -p ncp DefaultFixed
The output of netadm list should show the ncp online with DefaultFixed profile.
# netadm list
TYPE        PROFILE        STATE
ncp         Automatic      disabled
ncp         DefaultFixed   online
loc         Automatic      offline
loc         NoNet          offline
loc         DefaultFixed   online
2. Make sure you have unique MAC addresses for all the interfaces being used in the IPMP group
# eeprom local-mac-address?=true
# dladm show-linkprop -p mac-address
LINK     PROPERTY            PERM VALUE        DEFAULT      POSSIBLE
net1     mac-address         rw   0:c:29:12:40:79 0:c:29:12:40:79 --
net2     mac-address         rw   0:c:29:12:40:83 0:c:29:12:40:83 --
net3     mac-address         rw   0:c:29:12:40:8d 0:c:29:12:40:8d --
net0     mac-address         rw   0:c:29:12:40:6f 0:c:29:12:40:6f --
By default the link based failure detection is enabled. To check the failure detection method :
# ipmpstat -p
ipmpstat: probe-based failure detection is disabled
My virtual machine has 4 NIC cards as follows. I will be using net1 and net2 to configure the IPMP group.
# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             unknown    1000   full      e1000g0
net1              Ethernet             unknown    1000   full      e1000g1
net2              Ethernet             unknown    1000   full      e1000g2
net3              Ethernet             unknown    1000   full      e1000g3

1. Active/Active Configuration example

Active Interface : e1000g1 (net1)
                 : e1000g2 (net2)
Data IP          : 192.168.1.10
Create the IPMP group “ipmp0”.
# ipadm create-ipmp ipmp0
Create the interfaces net1 and net2 to be used in the IPMP group.
# ipadm create-ip net1
# ipadm create-ip net2
Add the two interfaces to the IPMP group
# ipadm add-ipmp -i net1 -i net2 ipmp0
To check the status of the IPMP group we just created :
# ipmpstat -g
GROUP       GROUPNAME   STATE     FDT       INTERFACES
ipmp0       ipmp0       ok        --        net2 net1
Add data IP address to the IPMP group. The syntax to do so is :
Syntax
ipadm create-addr -T static -a [hostname or IP address] [IPMP-interface]/[arbitrary-string]
# ipadm create-addr -T static -a 192.168.1.10 ipmp0/data1
To check the status of the IPMP interface :
# ipmpstat -a
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
ipmp0-data1               up     ipmp0       net1        net2 net1
# ipmpstat -an
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
192.168.1.10              up     ipmp0       net1        net2 net1
To check the status of individual interfaces in the IPMP group.
# ipmpstat -i
INTERFACE   ACTIVE  GROUP       FLAGS     LINK      PROBE     STATE
net2        yes     ipmp0       -------   up        disabled  ok
net1        yes     ipmp0       --mb---   up        disabled  ok
To check the IP address of the IPMP group :
# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
ipmp0/data1       static   ok           192.168.1.10/24
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net1: flags=1000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4] mtu 1500 index 12
        inet 0.0.0.0 netmask ff000000
        groupname ipmp0
        ether 0:c:29:12:40:79
net2: flags=1000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4] mtu 1500 index 13
        inet 0.0.0.0 netmask ff000000
        groupname ipmp0
        ether 0:c:29:12:40:83
ipmp0: flags=8001000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4,IPMP] mtu 1500 index 11
        inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
All the configuration changes we just made, are saved in the /etc/ipadm/ipadm-DefaultFixed.conf file (As we are using Fixed NCP)
# cat /etc/ipadm/ipadm-DefaultFixed.conf
_ifname=lo0;_aobjname=lo0/v4;   _ipv4saddr=string,127.0.0.1;prefixlen=string,8;up=string,yes;
_ifname=lo0;    _family=string,2,26;_class=uint64,2;
_ifname=net1;   _family=string,2,26;_class=uint64,0;_ipmpif=string,ipmp0;
_ifname=ipmp0;  _family=string,2,26;_class=uint64,1;_underif=string,net1,net2;
_ifname=net2;   _family=string,2,26;_class=uint64,0;_ipmpif=string,ipmp0;
_ifname=ipmp0;_aobjname=ipmp0/data1;    _ipv4saddr=string,192.168.1.10;up=string,yes;

2. Active/Standby Configuration Example

Let us configure an Active/Standby Link-Based IPMP configuration, by setting net2 as the standby interface.
Active Interface  : e1000g1 (net1)
Standby Interface : e1000g2 (net2)
Data IP           : 192.168.1.10
To set the net2 interface as standby interface :
# ipadm set-ifprop -p standby=on -m ip net2
Check the status of the individual interfaces. Observe the 2nd column. The net2 interface is not active.
#  ipmpstat -i
INTERFACE   ACTIVE  GROUP       FLAGS     LINK      PROBE     STATE
net2        no      ipmp0       is-----   up        disabled  ok
net1        yes     ipmp0       --mb---   up        disabled  ok
You can also confirm the STANDBY flag in the ifconfig command output.
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net1: flags=1000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4] mtu 1500 index 12
        inet 0.0.0.0 netmask ff000000
        groupname ipmp0
        ether 0:c:29:12:40:79
net2: flags=61000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4,STANDBY,INACTIVE] mtu 1500 index 13
        inet 0.0.0.0 netmask ff000000
        groupname ipmp0
        ether 0:c:29:12:40:83
ipmp0: flags=8001000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4,IPMP] mtu 1500 index 11
        inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
Check the status of the IPMP group and observe the net2 interface in (), as a contrast to the Active/Active configuration.
# ipmpstat -g
GROUP       GROUPNAME   STATE     FDT       INTERFACES
ipmp0       ipmp0       ok        --        net1 (net2)
Also note the difference in the output of the below command. Bothe the inbound and outbound traffic is on the interface net1.
# ipmpstat -an
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
192.168.1.10              up     ipmp0       net1        net1

How to configure Probe Based IPMP in Solaris 11 By Devan

How to configure Probe Based IPMP in Solaris 11

In the last post we have seen how to configure link based IPMP in solaris 11. Let us see how we can configure a probe-based IPMP in solaris 11.
Solaris 11 uses 2 methods for probe-based failure detection
1. Using test addreses (default method) 
2. Transitive Probing – No test addresses are used
To enable transitive probing :
# svccfg -s svc:/network/ipmp setprop config/transitive-probing=true
# svcadm refresh svc:/network/ipmp:default
To disable transitive probing :
# svccfg -s svc:/network/ipmp setprop config/transitive-probing=false
# svcadm refresh svc:/network/ipmp:default
To check the Probing method :
# ipmpstat -p

Active/Active Configuration Example (using test addresses)

The configuration details for the active/active IPMP configuration is as below :
IPMP group name  : ipmp0
Active interface : e1000g1 (net1)
                   e1000g2 (net2)

Data IP address  :  192.168.1.10
Test IP address  :  192.168.1.11 and 192.168.1.12
Firstly create the IPMP group ipmp0 :
# ipadm create-ipmp ipmp0
Create the 2 interfaces to be added to the IPMP group :
# ipadm create-ip net1
# ipadm create-ip net2
Add the 2 interfaces we just created to the IPMP group.
# ipadm add-ipmp -i net1 -i net2 ipmp0
Assign the test and data addresses to the respective interfaces :
# ipadm create-addr -T static -a 192.168.1.10 ipmp0/data1
# ipadm create-addr -T static -a 192.168.1.11 net1/test1
# ipadm create-addr -T static -a 192.168.1.12 net2/test2
To check the status of the IPMP group :
# ipmpstat -g
GROUP       GROUPNAME   STATE     FDT       INTERFACES
ipmp0       ipmp0       ok        10.00s    net2 net1
To check the Data address and interfaces in the IPMP group :
# ipmpstat -an
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
192.168.1.10              up     ipmp0       net1        net2 net1
To check the individual interfaces status in the
# ipmpstat -i
INTERFACE   ACTIVE  GROUP       FLAGS     LINK      PROBE     STATE
net2        yes     ipmp0       -------   up        ok        ok
net1        yes     ipmp0       --mb---   up        ok        ok
Here m -> the interface is used to send and receive multicast traffic in the IPMP group
b -> the interface is used to send and receive  broadcast traffic in the IPMP group
# ipmpstat -tn
INTERFACE   MODE       TESTADDR            TARGETS
net2        multicast  192.168.1.12        192.168.1.101
net1        multicast  192.168.1.11        192.168.1.101
If you observe the 2nd column above, it shows the mode to identify the probe targets in case of a probe based IPMP configuration. Different modes of failure detection are :
routes – system routing table is used to find probe targets.
multicast – multicast ICMP probes are used to find targets.
disabled – probe based failure detection has been disabled.
transitive – transitive probing is used to for failure detection.
And finally verify the configuration in the ifconfig command output.
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net1: flags=9040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER] mtu 1500 index 7
        inet 192.168.1.11 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:12:40:79
net2: flags=9040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER] mtu 1500 index 8
        inet 192.168.1.12 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:12:40:83
ipmp0: flags=8001000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4,IPMP] mtu 1500 index 6
        inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0

Active/Standby Configuration Example (using test addresses)

In the active/standby probe-based IPMP configuration, we will set net2 as the standby interface. The configuration details for the active/standby IPMP configuration is as below :
IPMP group name   : ipmp0
Active interface  : e1000g1 (net1)
Standby interface : e1000g2 (net2)

Data IP address   :  192.168.1.10
Test IP address   :  192.168.1.11 and 192.168.1.12
Create the 2 interfaces to be added to the IPMP group :
# ipadm create-ipmp ipmp0
Add the 2 interfaces we just created to the IPMP group.
# ipadm create-ip net1
# ipadm create-ip net2
# ipadm add-ipmp -i net1 -i net2 ipmp0
# ipadm create-addr -T static -a 192.168.1.10 ipmp0/data1
# ipadm create-addr -T static -a 192.168.1.11 net1/test1
# ipadm create-addr -T static -a 192.168.1.12 net2/test2
Assign the test and data addresses to the respective interfaces :
# ipadm set-ifprop -p standby=on -m ip net2
To check the status of the IPMP group (observe the net2 interface in ()) :
# ipmpstat -g
GROUP       GROUPNAME   STATE     FDT       INTERFACES
ipmp0       ipmp0       ok        10.00s    net1 (net2)
To check the IP address of the IPMP interface (observer that we have only net1 as the outbound interface, contrast to the active/active configuration):
# ipmpstat -an
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
192.168.1.10              up     ipmp0       net1        net1
To check the status of the individual interfaces :
# ipmpstat -i
INTERFACE   ACTIVE  GROUP       FLAGS     LINK      PROBE     STATE
net2        no      ipmp0       is-----   up        ok        ok
net1        yes     ipmp0       --mb---   up        ok        ok
To check the final configuration :
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net1: flags=9040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER] mtu 1500 index 10
        inet 192.168.1.11 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:12:40:79
net2: flags=69040843[UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,STANDBY,INACTIVE] mtu 1500 index 11
        inet 192.168.1.12 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0
        ether 0:c:29:12:40:83
ipmp0: flags=8001000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4,IPMP] mtu 1500 index 9
        inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255
        groupname ipmp0

Comparing Network configuration : Solaris 10 Vs Solaris 11 By Devan

Comparing Network configuration : Solaris 10 Vs Solaris 11

One of the best things I like about solaris 11 over solaris 10 is the huge change in the network stack in solaris 11. Oracle has added loads of new features to the networking stack of solaris 11. We’ll be discussing the new features in solaris 11 network stack and also compare it with solaris 10 where ever applicable.

Network Configuration Files

The use of below network files has been deprecated starting solaris 11 and it is being managed by SMF to have a Persistent network configuration across reboots.
/etc/defaultdomain
/etc/dhcp.*
/etc/hostname.*
/etc/hostname.ip*.tun*
/etc/nodename
/etc/nsswitch.conf

Network Configuration Profile

Solaris 11 uses profile-based network configuration. It has 2 configuration modes :
1. Automatic – Uses DHCP to obtain network configuration (IP address, router and DNS) from any of the connected ethernet interfaces. Do not support hot swapping of interfaces and IPMP.
2. Manual (DefaultFixed NCP) – interfaces needs to be manually configured using dladm and ipadm commands. Also called as DefaultFixed NCP. Supports hot swapping of interfaces and IPMP.
To check the NCP :
# netadm list
TYPE        PROFILE        STATE
ncp         Automatic      disabled
ncp         DefaultFixed   online
loc         Automatic      offline
loc         NoNet          offline
loc         DefaultFixed   online
As you can see currently the DefaultFixed profile is online and the automatic profile is in disabled state.
To enable the automatic NCP profile :
# netadm enable -p ncp Automatic
To enable the manual NCP profile
# netadm enable -p ncp DefaultFixed

Commands at Data link layer

In solaris 11 the dladm show-dev command doesn’t work and is replaced by the dladm show-phys command as shown below. One major change is now every interface in solaris 11 will be identified as “net#” ( for e.g. net0, net1), it includes the IPMP interface as well (as ipmp0). This helps in hot swapping of interfaces as the OS does not take into consideration the actual physical network device name and uses the concept of “vanity names” like net0, net1 etc..
Solaris 10 :
# dladm show-dev
e1000g0         link: up        speed: 1000  Mbps       duplex: full
Solaris 11 :
# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      e1000g0
Solaris 10 :
# dladm show-link
e1000g0         type: non-vlan  mtu: 1500       device: e1000g0
The OVER column in the below output will show on which physical data links the data link is operating (applicable only in case of aggr, vlan etc..).
Solaris 11 :
# dladm show-link
LINK                CLASS     MTU    STATE    OVER
net0                phys      1500   up       --

Commands at IP layer

The ifconfig command still works in solaris 11, but there are 2 more commands added in solaris 11 for viewing the IP addresses and MAC addresses of the interfaces.
Solaris 10 :
# ifconfig -a
lo0: flags=2001000849[UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL] mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4] mtu 1500 index 2
        inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255
        ether 0:c:29:f6:ef:67
Solaris 11:
# ipadm show-if
IFNAME     CLASS    STATE    ACTIVE OVER
lo0        loopback ok       yes    --
net0       ip       ok       yes    --
Above command shows the existing interfaces in the system.
# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/geeklab      static   ok           192.168.1.10/24
Above command shows us the MAC and IP addresses assigned to the interfaces.

Manual network Configuration

Let us now see an example to configure an IP address in both solaris 10 and solaris 11.
Solaris 10 :
# ifconfig e1000g1 plumb
# ifconfig e1000g1 192.168.1.20 netmask 255.255.255.0 up
We have to also edit the /etc/hosts, /etc/netmasks, /etc/hostname.e1000g1 files in order to make the new IP address persist reboot.
Solaris 11 :
Before configuring the IP address make sure you have enabled the manual NCP (DefaultFixed).
# netadm enable –p ncp DefaultFixed
# netadm list
Now we can configure the IP manually. ipadm command creates the new interface to be configured.
# ipadm create-ip net0
# ipadm create-addr –T static –a local=192.168.1.10/24 net0/geeklab
-T specifies either static, dhcp or addrconf (for IPv6) types of addresses.
the string geeklab can be any random string used to identify the interface.
# ipadm
NAME              CLASS/TYPE STATE        UNDER      ADDR
lo0               loopback   ok           --         --
   lo0/v4         static     ok           --         127.0.0.1/8
net0              ip         ok           --         --
   net0/geeklab   static     ok           --         192.168.1.10/24
The un-configuration of IP addresses is as follows in both solaris 10 and solaris 11 :
Solaris 10 :
# ifconfig unplumb e1000g1
Also remove the entries in /etc/hosts, /etc/netmasks and /etc/hostname.e10000g1 (remove the complete file).
Solaris 11 :
In case of solaris 11, even if you need to change the IP address of the interface, you have to delete and create the interface again.
# ipadm delete-ip net2

How to create and configure solaris 10 zones By Devan

How to create and configure solaris 10 zones

Solaris zones enables a software partitioning of solaris 10 OS to support multiple independent, secure OS environments to run in the same OS. Each environment has separate process space, resource allocation and users. Zones are widely used in production environments as it is easy to setup and doesn’t require any special hardware like ldoms does.

Zone types

Global zone – every installed OS acts like a global zone, which is present by default. All non-global zones can only be intalled, configured and administered from global zone.
Non-global zone – They share the functioning of the kernel booted under the global zone. All the software and other resources are inherited from the global zone.
Whole Root zone (Big zone) – It gets their own writable copy of all the file systems like /opt, /usr. It takes more disk space.
Sparse root zone (Small zone) – File systems like /opt, /usr are shared from global zone as loopback file-system (you only have a read-only access to these directories in non-global zone). It takes very less disk space.
Branded zones – These are solaris 8 or solaris 9 zones on the solaris 10 global zones.

Configuring a zone with minimal settings

Let us create a new zone with a minimal resources and settings required to get it up and running. We’ll see how to add other resources like cpu, memory, file system etc later in this post.We would be creating a sparse root zone in this case. To create a whole root zone we just have to use create -b instead of just create in the configuration prompt.
lobal# mkdir -p /zones/zone01
global# chmod 700 /zones/zone01
global# zonecfg -z zone01
zone01: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone01> create
zonecfg:zone01> set zonepath=/zones/zone01
zonecfg:zone01> set autoboot=true
zonecfg:zone01> verify
zonecfg:zone01> commit
zonecfg:zone01> exit

Install and boot the zone

Now install the zone and boot it. Upon booting we can login into the console of the zoen to configure it.
global# zoneadm -z zone01 verify
global# zoneadm -z zone01 install
global# zoneadm -z zone01 list -ivc
ID  NAME     STATUS       PATH                 BRAND      IP
 0  global   running      /                    native     shared
 -  zone01   installed    /zones/zone01        native     shared
global# zoneadm -z zone01 boot
global# zoneadm list -v
ID  NAME     STATUS       PATH                 BRAND      IP
 0  global   running      /                    native     shared
 1  zone01  running      /zones/zone01        native     shared
global# zlogin -C zone01
global # zlogin zone01
-C here connects you to the console of the zone. This has to be done only once to get the zone configured with hostname, timezone and other basic settings.

Resource configuration examples

Below are some most commonly used examples of resource configuration in a zone.
CPU
1. Dedicated CPU
To see the CPU information in the global zone you can use
global# psrinfo -v
global# psrinfo -vp
After you have confirmed the CPUs you want to use, you can add a fixed no of CPUs to the zone.
zonecfg:zone01> add dedicated-cpu
zonecfg:zone01:dedicated-cpu> set ncpus=1-2
zonecfg:zone01:dedicated-cpu> set importance=10   (optional, default is 1)
zonecfg:zone01:dedicated-cpu> end
Memory
Capped Memory
zonecfg:zone01> add capped-memory
zonecfg:zone01:capped-memory> set physical=50m  [max memory that can be used by this zone]
zonecfg:zone01:capped-memory> set swap=100m
zonecfg:zone01:capped-memory> set locked=30m  [memory locked for use by this zone]
zonecfg:zone01:capped-memory> end
File system
a. Loopback FS
zonecfg:zone01> add fs
zonecfg:zone01:fs> set dir=/usr/local
zonecfg:zone01:fs> set special=/opt/zones/zone01/local
zonecfg:zone01:fs> set type=lofs
zonecfg:zone01:fs> end
here /usr/local will be readable and writable in non-global zone
b. Normal file system
zonecfg:zone01> add fs
zonecfg:zone01:fs> set dir=/data01
zonecfg:zone0101:fs> set special=/dev/dsk/c1t1d0s0
zonecfg:zone0101:fs> set raw=/dev/rdsk/c1t1d0s0
zonecfg:zone0101:fs> add options [logging, nosuid]    (optional)
zonecfg:zone0101:fs> end
ZFS dataset
When we delegate a dataset to a non-global zone we can do any operation on that dataset inside of the zone without requiring global zone to configure it all the time.
zonecfg:zone01> add dataset
zonecfg:zone01> set name=tank/sales
zonecfg:zone01> end
Inherit package (sparse root zone only)
Now in case of sparse root zone we can inherit some of the packages from the global zone.
zonecfg:zone01> add inherit-pkg-dir
zonecfg:zone01:inherit-pkg-dir> set dir=/opt/sfw
zonecfg:zone01:inherit-pkg-dir> end
NOTE: These resources can not be modified once the zone is installed
IP
We can either give an exclusive IP using a dedicated interface to a non-global zone or use an existing interface in the global zone to share it with the non-global zone. When we configure an exclusive IP we have to configure IP address inside of the non-global zone and not during the configuration.
a. Exclusive IP
zonecfg:zone01> set ip-type=exclusive
zonecfg:zone01> add net
zonecfg:zone01:net> set physical=hme0
NOTE: No need to specify IP here you can control everything from inside of the non-global zone
b. Shared IP
In this case zone uses a shared interface which is already plumbed and being used in the global zone.
zonecfg:zone01> add net
zonecfg:zone01:net> set address=192.168.1.2
zonecfg:zone01:net> set physical=hme0
zonecfg:zone01:net> set defrouter=10.0.0.1   [optional]
zonecfg:zone01:net> end
Device
We can also directly assign a physical device like disk to a non-global disk.
zonecfg:zone01> add device
zonecfg:zone01:device> set match=/dev/rdsk/c0t1d0
zonecfg:zone01:device> end
Comments
In case you want to add some comments like function of the non-global zone or anything else for that matter.
zonecfg:zone01> add attr
zonecfg:zone01:attr> set name=comment
zonecfg:zone01:attr> set type=string
zonecfg:zone01:attr> set value="Hello World. This is my zone"
zonecfg:zone01:attr> end
Other
Other settings like scheduling class of the CPU in the non-global zone can also be configured from the global zone.
zonecfg:zone01> set limitpriv="default,sys_time"
zonecfg:zone01> set scheduling-class=FSS

Other administrative commands

To reboot a zone :                 # zoneadm -z  reboot
To halt a zone :                   # zoneadm -z zone halt
To uninstalling a zone :           # zoneadm -z zone uninstall -F
To delete an uninstalled zone :    # zonecfg -z zone delete -F
Get all configuration info :       # zonecfg -z zone info
login into a zone in safe mode :   # zlogin -S zone
prstat on all zones :              # prstat -Z
prstat on a single zone :          # prstat -z zone