7. 朱Μ 11 ろ語
root@sol11-2:~# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
net0 Ethernet up 1000 full e1000g0
root@sol11-2:~# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 up --
net1 phys 1500 up --
root@sol11-2:~# svcs network/physical
STATE STIME FMRI
online 7:11:26 svc:/network/physical:upgrade
online 7:11:30 svc:/network/physical:default
8. ろ語 誤壱伎 覦 蟲
root@sol11-2:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip ok yes --
root@sol11-2:~# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
net0/v4 static ok 10.0.2.15/24
net1/v4 static ok 192.168.10.198/24
lo0/v6 static ok ::1/128
net0/v6 addrconf ok fe80::a00:27ff:fe58:6d98/10
9. NIC 覦 IP
root@sol11-2:~# ipadm create-ip net1
root@sol11-2:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip down no --
root@sol11-2:~# ipadm create-addr -T static -a 192.168.10.198/24
net1/v4
DHCP 蟆曙
root@sol11-2:~# ipadm create-addr -T dhcp net1/v4
10. NIC 覦 IP
root@sol11-2:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip ok yes --
root@sol11-2:~# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
net0/v4 static ok 10.0.2.15/24
net1/v4 static ok 192.168.10.198/24
lo0/v6 static ok ::1/128
net0/v6 addrconf ok fe80::a00:27ff:fe58:6d98/10
11. NIC 觜燕 / 燕
root@sol11-2:~# ipadm down-addr net1/v4
root@sol11-2:~# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
net0/v4 static ok 10.0.2.15/24
net1/v4 static down 192.168.10.198/24
root@sol11-2:~# ipadm up-addr net1/v4
root@sol11-2:~# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
net0/v4 static ok 10.0.2.15/24
net1/v4 static ok 192.168.10.198/24
12. NIC IP 蟇
root@sol11-2:~# ipadm delete-addr net1/v4
root@sol11-2:~# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
net0/v4 static ok 10.0.2.15/24
lo0/v6 static ok ::1/128
net0/v6 addrconf ok fe80::a00:27ff:fe58:6d98/10
root@sol11-2:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip down no --
13. NIC 蟇
root@sol11-2:~# ipadm delete-ip net1
root@sol11-2:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
14. 殊壱 蟲 覦 DNS 蟲
# route p add default 192.168.10.1
# svccfg s dns/client setprop config/nameserver =
net_address: 192.168.10.253
# svccfg s dns/client setprop config/domain =
astring: oracle.com
# svccfg s name-service/switch setprop config/host =
astring: files dns
# svcadm refresh name-service/switch
# svcadm refresh dns/client
17. 螳 ろ語 れ豺
root@sol11-2:~# dladm create-etherstub vswitch0
root@sol11-2:~# dladm show-etherstub
LINK
vswitch0
root@sol11-2:~# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 up --
net1 phys 1500 up --
vswitch0 etherstub 9000 unknown --
18. 螳 ろ語 誤壱伎れ
root@sol11-2:~# dladm create-vnic -l vswitch0 webint0
root@sol11-2:~# dladm show-vnic
LINK OVER SPEED MACADDRESS MACADDRTYPE VIDS
webint0 vswitch0 40000 2:8:20:1c:7a:4a random 0
22. ZFS rpool 伎 zone
# zfs list | grep zone
rpool/VARSHARE/zones 31K 20.3G 31K /system/zones
# zfs create -o mountpoint=/zones rpool/zones
# zfs list rpool/zones
NAME USED AVAIL REFER MOUNTPOINT
rpool/zones 31K 20.3G 31K /zones
23. ZONE 蟲
root@sol11-2:~# zonecfg -z webzone
Use 'create' to begin configuring a new zone.
zonecfg:webzone> create
create: Using system default template 'SYSdefault'
zonecfg:webzone> set zonepath=/zones/webzone
zonecfg:webzone> add net
zonecfg:webzone:net> set physical=webint0
zonecfg:webzone:net> end
zonecfg:webzone> verify
zonecfg:webzone> commit
zonecfg:webzone> exit
24. ZONE
root@sol11-2:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- webzone configured /zones/webzone solaris excl
- dbzone configured /zones/dbzone solaris excl
27. ZONE れ
root@sol11-2:~# zoneadm -z webzone install
-c /root/webzone-profile.xml
The following ZFS file system(s) have been created:
rpool/zones/webzone
Progress being logged to
/var/log/zones/zoneadm.20140505T045317Z.webzone.install
Image: Preparing at /zones/webzone/root.
Install Log: /system/volatile/install.3914/install_log
AI Manifest: /tmp/manifest.xml.OdaWNh
SC Profile: /root/webzone-profile.xml
Zonename: webzone
Installation: Starting ...
28. ZONE 覿
root@sol11-2:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- webzone installed /zones/webzone solaris excl
root@sol11-2:~# zoneadm -z webzone boot
root@sol11-2:~# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- webzone running /zones/webzone solaris excl
29. ZONE 襦蠏語 覦 螳 NIC 覦 蟲 1
root@sol11-2:~# zlogin webzone
[Connected to zone 'webzone' pts/3]
Oracle Corporation SunOS 5.11 11.2 April 2014
root@webzone:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
30. ZONE 襦蠏語 覦 螳 NIC 覦 蟲 2
root@webzone:~# dladm
LINK CLASS MTU STATE OVER
webint0 vnic 9000 unknown ?
net0 vnic 1500 up ?
root@webzone:~# ipadm create-ip net0
root@webzone:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
net0 ip down -- --
31. ZONE 襦蠏語 覦 螳 NIC 覦 蟲 3
root@webzone:~# ipadm create-addr -T static -a 10.0.2.16/24
net0 net0/v4
root@webzone:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
net0 ip ok -- --
net0/v4 static ok -- 10.0.2.16/24
root@webzone:~# ping 10.0.2.15
10.0.2.15 is alive
32. Secure by Default 伎
root@webzone:~# ipfstat -io
block out log all
pass out quick on lo0 all
pass out quick proto udp from any to any port = bootps
block in log all
pass in quick on lo0 all
pass in quick proto udp from any to any port = bootpc
root@webzone:~# svcadm disable svc:/network/ipfilter
root@webzone:~# ipfstat -io
empty list for ipfilter(out)
empty list for ipfilter(in)
33. ZONE 襦蠏語 覦 螳 NIC 覦 蟲 4
root@webzone:~# ipadm create-ip webint0
root@webzone:~# ipadm create-addr -a local=10.0.3.10/24
webint0/v4
root@webzone:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
net0 ip ok -- --
net0/v4 static ok -- 10.0.2.16/24
webint0 ip ok -- --
webint0/v4 static ok -- 10.0.3.10/24
34. Webzone 觜 蟲
AMP(Apache / MySQL / PHP) れ 覦
root@webzone:~# pkg install amp
root@webzone:~# pkg list *apache*
root@webzone:~# pkg list *php*
root@webzone:~# pkg list *mysql*
root@webzone:~# svcadm enable apache22
root@webzone:~# svcs apache22
STATE STIME FMRI
online 19:12:50 svc:/network/http:apache22
37. ろ語 襴 螳
一 蟯襴
root@sol11-2:~# dladm set-linkprop -p priority=high webint0
root@sol11-2:~# dladm show-linkprop -p priority webint0
LINK PROPERTY PERM VALUE EFFECTIVE DEFAULT POSSIBLE
webint0 priority rw high high medium low,medium,
high
38. ろ語 襴 螳
襴
#flowadm add-flow l net0 a transport=tcp,local_port=80 http
#flowadm show-flowprop http
39. 襴 蟯襴
Resource pool : cpu 蟯襴 譯朱
Resource Capping : 覓朱Μ 覃覈襴 觜襯 譟一
rcapd 磯 蟯襴 rcapd 磯螻 rcap 觜 覦 蟲
Capped-memory ( 覓朱Μ覃覈襴, れ, 覃覈襴 蠍)
Process scheduling : 襦語り cpu 轟