Home | :: | About | :: | Download | :: | Install | :: | Use | :: | Blog |
If the network configuration of a host changes, then you may have to change the IP addresses of your zones. For example, I changed my broadband provider at home, and the old ISP router used the 192.168.0 network, while the new router used the 192.168.1 network.
In this case, if you're using DHCP (explicitly or automatically via NWAM which is the default) the change will be picked up automatically. But the zone configuration will have the old IP addresses embedded and those need to be updated.
The examples below are appropriate for a network change from 192.168.0 to 192.168.1.
For a shared-ip zone, you just need to change the address for each zone.
Having found the old address (via ifconfig
for example, run the
command
zonecfg -z illumos-build
and then update the address
select net address=192.168.0.211/24 set address=192.168.1.211/24 end verify commit exit
Then you'll need to get the zone to use the new address by rebooting it:
zoneadm -z illumos-build reboot
For an exclusive-ip zone (and all LX or bhyve zones will be exclusive-ip) the parameters in the zone configuration are slightly different, you need to identify the name of the virtual interface (vnic) that's in use. Then run the command
zonecfg -z alpine1
and then update the address
select net physical=znic0 set allowed-address=192.168.1.239/24 set defrouter=192.168.1.1 end verify commit exit
Then you'll need to get the zone to use the new address by rebooting it:
zoneadm -z alpine1 reboot
You may then need to get whatever's inside the zone to pick up the changes, if it's been statically configured. For example, with an LX zone running alpine you'll need to log in to the console via VNC and run setup-interfaces.
There's one additional step needed for all zones, as zap saves the
network configuration for its own use. This can be fixed by updating the
relevant zconfig
files stored in /var/zap/zones
:
cd /var/zap/zones sed -i s:192.168.0:192.168.1: zconfig.*
Index | Previous Section | Next Section