Pages

Thursday, January 31, 2013

Change the IP of a Solaris Zone

To change the IP of a Solaris Zone start zonecfg with the configured zone first:

# zonecfg -z bck01

The name of the zone is bck01. Within zonecfg run info to view the current configuration of the zone: 

zonecfg:bck01> info
...
net:
        address: 192.168.1.76
        physical: ce2
        defrouter: 192.168.1.73
...


Next select any network resource like the physical interface to reconfigure your network settings:

zonecfg:bck01> select net physical=ce2

Finally change everything you need, eg. the IP and the default router:

zonecfg:bck01:net> set address=172.16.1.76
zonecfg:bck01:net> set defrouter=172.16.1.73


When all changes are done leave the network configuration:

zonecfg:bck01:net> end

Type info again to validate the changes for yourself:

zonecfg:bck01> info
...
net:
        address: 172.16.1.76
        physical: ce2
        defrouter: 172.16.1.73
...


When all changes are correct run verify and commit to verify and save the new configuration:

zonecfg:bck01> verify
zonecfg:bck01> commit


Leave zonecfg:

zonecfg:bck01> exit

Then start zlogin to follow the boot messages:

# zlogin -C bck01

And finally start your zone:

# zoneadm -z bck01 boot


No comments:

Post a Comment