Friday, February 21, 2014

SmartOS: add (modify) the gateway to a zone

I often forget to add the gateway to a new created zone.

So, get the nic MAC address.

vmadm get zone-uuid | json -a nics.0.mac


Create a file, like /var/tmp/updategw.json

   "update_nics": [
         "mac": "52:d9:d7:ab:c7:56",
         "gateway": ""

Stop the zone, then issue an update.

vmadm update zone-uuid < /var/tmp/updategw.json


vmadm get <zone-uuid> | json -a nics.0

Start the zone.

No comments:

Post a Comment