Any script to add IP's in zone ?

Thread Tools Search this Thread
Operating Systems Solaris Any script to add IP's in zone ?
# 1  
Old 12-17-2013
Any script to add IP's in zone ?

I have a Solaris-11 box, which is hosting 3 non-global zones. I am going to add 38 IP address to each zones (144 for all three zones). I kept those IP addresses in three files - /tmp/zone1_ip is having all ip's which needs to add in zone1, /tmp/zone2_ip is having ip's for zone2 and /tmp/zone3_ip for zone3. Is there any script or way to do it quickly ? Or else I will need to add it one by one like -
zonecfg -z zone1
zonecfg:zone1> add net
zonecfg:zone1:net> set address=xx.xx.xx.xx
zonecfg:zone1:net> set physical=net0
zonecfg:zone1:net> end
zonecfg:zone1> commit
zonecfg:zone1> exit

# 2  
Old 12-17-2013
zonecfg man page (Synopsis - man pages section 1M: System Administration Commands) contains example on how to add resources in a non-interactive fasion:
zonecfg -z myzone "add net; set physical=myvnic; end"

This User Gave Thanks to bartus11 For This Post:
# 3  
Old 12-17-2013
Thanks bartus, I was able to add it quickly with this command and for loop
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Need to know the procedure to add the IP to Solaris 11 zone with rebooting

Hi I need to know the procedure to add the IP to Solaris 11 zone without rebooting the zone.. I did it on solaris 10 zones but don't know the procedure on solaris 11 zones without rebooting it (1 Reply)
Discussion started by: hb00
1 Replies

2. Solaris

Solaris 11 zone has no external network access (except to Global Zone)

Hi, hoping someone can help, its been a while since I used Solaris. After creating a NGZ (non global zone), the NGZ can access the GZ (Global Zone) and the GZ can access the NGZ (using ssh, zlogin) However, the NGZ cannot access any other netwqork devices, it can't even see the default router ... (2 Replies)
Discussion started by: GazinLincoln
2 Replies

3. UNIX for Advanced & Expert Users

Solaris 10: I forgot to detach a zone before zpool export. Uninstall zone?

Dear all, recently, I migrated a solaris zone from one host to another. The zone was inside of a zpool. The zpool cotains two volumes. I did the following: host1: $ zlogin zone1 shutdown -y -g0 -i0 #Zone status changes from running to installed $ zpool export zone1 host2: $ zpool... (2 Replies)
Discussion started by: custos
2 Replies

4. Solaris

Scripting changes to multiple zone configurations in the same Global Zone

So this is Solaris 11.1. I have a Global zone that has several non-global zones running in it. I want to change the capped-memory.physical resources setting in ALL the zone configs of the running zones. if I were to do this manually here's what I would do: zonecfg -z zone1 select... (2 Replies)
Discussion started by: os2mac
2 Replies

5. Solaris

showing 2 different time zones in global zone and nonglobal zone

can some one help me out as it is showing 2 different time zones in global zone and nonglobal zone .In global zone it is showing in GMT while in nonglobal zone i it showing as PDT. System in running with solaris 10 (3 Replies)
Discussion started by: ravijanjanam12
3 Replies

6. Solaris

Zone failes to boot due to mount issue, dir exists in zone.

I have two physical servers, with zones that mount local storage. We were using "raw device" in the zonecfg to point to a metadevice on the global zone (it was not mounted in the global zone at any point). It failed to mount on every boot because the directory existed in the zone. I... (6 Replies)
Discussion started by: BG_JrAdmin
6 Replies

7. Solaris

how to add a default gateway in a zone of different VLAN of global zone

Hi Greetings... I have an issue in connecting the zone from outside the network and it is because of default gateway. I can ping default gateway from inside the zone and not able to ping from global zone due to different VLAN issue. If i add two different gateways and restart network services,... (2 Replies)
Discussion started by: vvpotugunta
2 Replies

8. Solaris

is it possible to add physical hardware to a zone

Dear All, is it possible to add physical hardware to a zone like, cdrom, processor book, scsi controller ?, r else any disk.... any thing that will b a physical hardware!! is it possible.... if possible please tel me the steps while Thanks (7 Replies)
Discussion started by: kumarmani
7 Replies

9. Solaris

Bind zone transfer recategorises zone file?

Hi, I have a primary/slave Bind 9 setup running on a Solaris 10 platform. Everything is hunky dorey, except for when I make a zone file change and up the serial the file that is transferred to the slave looses all its comments, and the entries are place in alphabetical order. I administer many... (1 Reply)
Discussion started by: fulhamfcboy
1 Replies
Login or Register to Ask a Question