Photon OS 官方網站:https://vmware.github.io/photon/
1. 下載 Photon OS,這裡下載的是 Full ISO
[@more@]2. 先把 ISO 檔上傳到 ESXi Server 資料存放區
選擇安裝的方式,詳細可以參考 用ESXi建Photon OS虛擬機 打造超輕量Docker環境 – 專題報導 – 網管人NetAdmin
6. 進行設定
SSH Server 設定
# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.$(date +%F)
# sed -i ‘s/PermitRootLogin no/PermitRootLogin yes/’ /etc/ssh/sshd_config
# systemctl restart sshd.service
7. 設定網路
# sed -i ‘s/DHCP=yes/DHCP=no/’ /etc/systemd/network/10-dhcp-en.network
# networkctl | grep configured
2 eth0 ether routable configured
設定網路
# vim /etc/systemd/network/10-static-en.network
[Match]
Name=eth0
[Network]
Address=192.168.1.134/24
Gateway=192.168.1.2
Address=2001:288:a229:1::134/64
Gateway=2001:288:a229:1::ffff
DNS=8.8.8.8
DNS=168.95.1.1
Domains=photon.local
# chmod 644 /etc/systemd/network/10-static-en.network
重新啟動網路
# systemctl restart systemd-networkd.service
測試 DNS 查詢是否正常
# ping -c 3 www.ilc.edu.tw
PING www.ilc.edu.tw (140.111.66.96) 56(84) bytes of data.
64 bytes from server96.ilc.edu.tw (140.111.66.96): icmp_seq=1 ttl=126 time=1.06 ms
64 bytes from server96.ilc.edu.tw (140.111.66.96): icmp_seq=2 ttl=126 time=1.16 ms
64 bytes from server96.ilc.edu.tw (140.111.66.96): icmp_seq=3 ttl=126 time=0.983 ms
# ping6 -c 3 www.ilc.edu.tw
PING www.ilc.edu.tw(2001:288:a201::66:96) 56 data bytes
64 bytes from 2001:288:a201::66:96: icmp_seq=1 ttl=126 time=1.67 ms
64 bytes from 2001:288:a201::66:96: icmp_seq=2 ttl=126 time=1.68 ms
64 bytes from 2001:288:a201::66:96: icmp_seq=3 ttl=126 time=1.53 ms
8. 設定防火牆
# vim /etc/systemd/scripts/iptables
把
iptables -A INPUT -p tcp –dport 22 -j ACCEPT
修改成
iptables -A INPUT -p tcp -s 192.168.1.0/24 –dport 22 -j ACCEPT
# systemctl restart iptables.service
# iptables -L -n
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all — 0.0.0.0/0 0.0.0.0/0
ACCEPT all — 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
ACCEPT tcp — 192.168.1.0/24 0.0.0.0/0 tcp dpt:22
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all — 0.0.0.0/0 0.0.0.0/0
9. 設定時區
# rm -rf /etc/localtime
# ln -s /usr/share/zoneinfo/Asia/Taipei /etc/localtime
# date
Fri Mar 31 17:57:10 CST 2017
10. 設定開機時啟動 docker
# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
# systemctl start docker.service