Solaris Configuration Notes

From Smithnet

Jump to: navigation, search

Contents

Permit root login

  • svcadm enable ssh:default

For non-console access

  • /etc/ssh/sshd_config
  • /etc/default/login

Network

  • /etc/defaultrouter
  • /etc/hostname.e1000g0 (suffix of interface name)

To use DHCP:

 ifconfig e1000g0 plumb
 ifconfig e1000g0 dhcp

Static config:

 ifconfig pcn0 plumb
 ifconfig pcn0 inet 192.168.0.50 netmask 255.255.255.0 up
 route add default 192.168.0.1

Zones

Create an area on the container filesystem for the zone:

  • eg /zones/zone1
  • Should not be group and world read/executable

Create a zone "zone1":

  • zonecfg -z zone1

Within the interactive prompt:

 create
 set autoboot=true
 set zonepath=/zones/zone1
 add inherit-pkg-dir
 set dir=/opt
 end
 info
 add net
 set address=192.168.0.10/24
 set physical=e1000g0
 set defrouter=192.168.0.1
 end
 verify
 commit
 exit

(this creates a sparse zone with packages inherited from the global zone, left in configured state)

Install the zone:

  • zoneadm -z zone1 install

Connect to the zone console (enter "~." to leave):

  • zlogin -C zone1

From a normal console, boot the zone:

  • zoneadm -z zone1 boot

Show status of the zone:

  • zoneadm list -cv

Shutdown a zone:

  • zoneadm -z zone1 shutdown
  • zoneadm -z zone1 halt

List all zones and status:

  • zoneadmin list -vi

Exclusive

By default, zones are created in "ip-type=share" mode. This limits the routing and submets that can be used within the zone. An exclusive zone allocates a global zone's physical NIC exclusive access to a zone, using:

 create
 set autoboot=true
 set zonepath=/zones/zone2
 add inherit-pkg-dir
 set dir=/opt
 end
 set ip-type=exclusive
 info
 add net
 set physical=e1000g0
 end
 verify
 commit
 exit

Inside an exclusive-IP zone, ifconfig can be used to configure the IP and networking. This IP is not directly visible from the global zone; instead log into the zone:

 zlogin zone2 ifconfig -a
Personal tools