Site icon UnixArena

How to plumb new IP in the zone on fly

As we all know that plumbing a new interface and assigning a IP address in Solaris 10 global zone. Have you ever added the new IP address in local zone without rebooting it ? Will it work by adding the IP information in zone’s configuration using zonecfg ? No. If you add a any new configuration in zonecfg, it requires a reboot. But oracle offers other ways to plumb the IP in to local zone on the fly.

 Here is step by step guide to add a new IP address in local zone. But prior to that ,we should create virtual NIC instance in global.

Setup:
Here i am having aggregation “aggr1312012″ and instance “aggr1312012:1″ used by some other zones. So i need to create aggr1312012:2 for new IP address on the global zone.
 
Here I am just verifying how many virtual aggregations already exists for aggr1312012.
[root@ global ~]# ifconfig -a |grep -i aggr1312012
aggr1312012: flags=201000842 mtu 1500 index 10
aggr1312012:1: flags=201000843 mtu 1500 index 10

So now we are good to plumb the instance 2 from aggregation aggr1312012. The new virtual insterface will  be aggr1312012:2 .

1. Create the new aggregate instance.
 [root@global ~]# ifconfig aggr1312012:2 plumb
2.Checking the newly created virtual instance
[root@global ~]# ifconfig -a |grep -i aggr1312012
aggr1312012: flags=201000842 mtu 1500 index 10
aggr1312012:1: flags=201000843 mtu 1500 index 10
aggr1312012:2: flags=201000842 mtu 1500 index 10
3. Login in to local zone and verify the existing IP.
[root@global ~]# zlogin localzone
# ifconfig -a
lo0:6: flags=2001000849 mtu 8232 index 1
       inet 127.0.0.1 netmask ff000000
aggr1312012:1: flags=201000843 mtu 1500 index 10
       inet 101.10.117.140 netmask ffffffc0 broadcast 101.10.117.191
# exit
[Connection to zone 'localzone' pts/19 closed]
4.Propagate the new IP on local zone.
[root@global ~]# ifconfig aggr1312012:2  101.10.117.135 netmask 255.255.255.192 zone localzone
[root@global ~]# ifconfig aggr1312012:2 up

[root@global ~]# zlogin localzone
[Connected to zone 'localzone' pts/19]
Last login: Thu Jan 12 23:11:57 on pts/19
# ifconfig -a
lo0:5: flags=2001000849 mtu 8232 index 1
       inet 127.0.0.1 netmask ff000000
aggr1312012:2: flags=201000843 mtu 1500 index 10
       inet 101.10.117.135 netmask ffffffc0 broadcast 101.10.117.191
aggr1312012:1: flags=201000843 mtu 1500 index 10
       inet 101.10.117.140 netmask ffffffc0 broadcast 101.10.117.191
# exit
[Connection to zone 'localzone' pts/19 closed]
[root@global ~]#
5. Using zonecfg,  you can add the new IP information to this zone. So that newly configured IP will be persist across the  reboot.
zonecfg -z Arena-zone
zonecfg:Arena-zone> add net
zonecfg:Arena-zone>set address=101.10.117.135
zonecfg:Arena-zone>set physical=aggr1312012
zonecfg:Arena-zone>end


The same way you can un-plumb the IP address from the local zone and you can remove the address  permanently  by removing the entries from zonecfg.

 Thank you for reading this article. Please leave a comment if you have any doubt.

Exit mobile version