Wednesday, September 19, 2007

NWAM and zones

Of course, NWAM wont help me at all with zones on a laptop, or will it? If my wired interface is not plumbed, I cant tie a zone to physical bge0 (my network card on my laptop). Before NWAM (network/physical:nwam) I had found a way to assign a secondary IP to bge0 and that worked to some extent. Basically, you would define an addif to /etc/hostname.bge0 and bge0:1 would come up, with bge0 plumbed or not, and the zones would be on that same network.

Let's try. I unplug the laptop from the network and reboot, so that bge0 is nowhere to be seen. 172.16.0.0 is one of the reserved private B class (up to 172.31.0.0) that is available, with plenty of breathing room (instead of potentially dealing with multiple C classes). Adding to /etc/hosts


172.16.0.2 globalzone
172.16.0.3 zone1
172.16.0.4 zone2 etc.


and adding to /etc/hostname.bge0


addif globalzone


Reboot, and... it didn't work. Hmmm. Maybe the standard way to assign IPs and NWAM can coexist.


# svcs | grep network
[...]

This shows many services, but two that are dealing with physical.


# svcs | grep physical

online 12:46:34 svc:/network/physical:nwam
disabled 12:46:37 svc:/network/physical:default

# svcadm enable network/physical:default

# svcs | grep physical
online 12:46:34 svc:/network/physical:nwam
online 14:48:46 svc:/network/physical:default

# ifconfig -a

bge0:1: flags=201000843 mtu 1500 index 2
inet 172.16.0.2 netmask ffff0000 broadcast 172.16.255.255



We are up, yay! We can now proceed at the installation of zones on a laptop without worry about network access (very useful for demos on the road).

In the next blogs I'll show why zones are so cool for a desktop or laptop (it's not just for servers, you know). I'll also show how you can gain (real) network access from a zone.

No comments: