We have seen previously that we can manage the Oracle Solaris 11 network configuration using the command ipadm. In this tutorial we go beyond ipadm and look at how we can create Network Configuration Profiles or NCPs that hold network configuration settings that can be loaded as required. This way it is possible to maintain network addresses required for different locations; we just need to make sure that we create NCPs for the required address configurations.
We can list profiles, both location and NCPs with either:
Both will show the configurations but in slightly different formats. We use the command netcfg though to create the profiles. We should see that with either command we have two profiles created by default on a new Solaris system
We shall create two new profiles, NCPs; office and home. Office will have a static IP Address and Home a DHCP assigned address.
netcfg create ncp home netcfg create ncp office
The above commands will create the NCPs but they will not have any configuration yet. They will show in the output of netcfg list or netadm list.
We then need to configure the networking settings, this will be the physical and ip settings to use. We can do this using netcfg interactively choosing from the menu or scripted. Both here an in the video we will make these settings through the inetractive mode of netcfg.
netcfg >select ncp office >create ncu phys net0 >manual >enter on MAC >enter on autopush >end >create ncu ip net0 >IPv4 >static >192.168.40.3 >192.168.40.2 >end
We can do similar for the home profile but choosing DHCP in place of static.
To enable an NCP profile
netadm enable office
netadm enable home
So long as NCP name does not clash with a location name we are OK, but if you would like to switch back to the Automatic profile which also shares the name with a Location we have to use
netadm -p ncp enable Automatic
This way we are easily able to change network configuration parameters if the machine we use moves, such as a laptop or perhaps a Virtual Machine that we can use at home on within a datacentre.