$sw = [System.Diagnostics.Stopwatch]::StartNew()
$fs = [System.IO.File]::Create("C:\test1.img")
$buffer = New-Object byte[] (1MB)
1..1024 | ForEach-Object {
$fs.Write($buffer, 0, $buffer.Length)
}
$fs.Flush($true)
$fs.Close()
$sw.Stop()
$speed = 1024 / $sw.Elapsed.TotalSeconds
"Elapsed: $($sw.Elapsed.TotalSeconds) sec"
"Write Speed: $([math]::Round($speed,2)) MB/s"
dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync
dd if=/tmp/test1.img of=/dev/null bs=1G iflag=direct
wget -o Updater.sh https://d111xps0uy3x00.cloudfront.net/res/product/NAKIVO%20Backup_Replication%20v11.2.1.104556%20Updater.exe
chmod +w ./Updater.sh
sudo Updater.sh
cilium status
Cilium: OK
Operator: OK
Envoy DaemonSet: OK
kubectl -n kube-system get cm cilium-config -o yaml | grep kube-proxy
kube-proxy-replacement: "true"
kubectl -n kube-system get cm cilium-config -o yaml | grep envoy
envoy.enabled: "true"
kubectl -n kube-system get cm cilium-config -o yaml | grep gateway
gatewayAPI.enable: "true"
helm upgrade cilium cilium/cilium --namespace kube-system --reuse-values --set l2announcements.enabled=true
kubectl -n kube-system get cm cilium-config -o yaml | grep l2
enable-l2-announcements: "true"
apiVersion: cilium.io/v2alpha1
kind: CiliumLoadBalancerIPPool
metadata:
name: lan-pool
spec:
blocks:
- start: XX.XX.XX.200
stop: XX.XX.XX.220
โดยที่ XX.XX.XX = subnet class ของท่านใช่ 192.168.10kubectl apply -f cilium-lb-pool.yaml
kubectl get ciliumloadbalancerippools
apiVersion: cilium.io/v2alpha1
kind: CiliumL2AnnouncementPolicy
metadata:
name: lan-policy
spec:
nodeSelector:
matchLabels: {}
serviceSelector:
matchLabels: {}
interfaces:
- ens18
loadBalancerIPs: true
kubectl apply -f cilium-l2-policy.yaml
kubectl get ciliuml2announcementpolicies
kubectl create deployment nginx --image=nginx
kubectl expose deployment nginx --name nginx --type LoadBalancer --port 80 --target-port 80
kubectl describe svc nginx
Type: LoadBalancer
Port: 80/TCP
TargetPort: 80/TCP
LoadBalancer Ingress:
xx.xx.xx.x
kubectl get svc nginx
here was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "", "--type", "headless"]
Stderr: VBoxManage: error: VirtualBox can't enable the AMD-V extension. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_SVM_IN_USE)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
ให้ท่านแก้ไขโดยการลบ module kvm ดังนี้sudo rmmod kvm_amd
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install vagrant
mokutil --sb-state
หากผลลัพธ์ของการพิมพ์คำสั่งคือ Enabled ท่านจะต้องทำการปิด Secure Boot ก่อนsudo apt install virtualbox
ต่อไปเราต้องการลง metasploitable3 ซึ่งเป็น vm ที่มีช่องโหว่เอาไว้ทดสอบเรื่องความปลอดภัยmkdir metasploitable3-workspace
cd metasploitable3-workspace
และทำการโหลด Vagrant file เพื่อทำการ deploy VMs โดยใช้คำสั่งwget -O Vagrantfile https://raw.githubusercontent.com/rapid7/metasploitable3/master/Vagrantfile
หลังจากนั้นทำการรันโดยการพิมพ์vagrant up
หากท่านได้ error ว่าsudo mkdir /etc/vbox
sudo nano /etc/vbox/networks.conf
และใส่ข้อความคือ * 0.0.0.0/0 ::/0 ในไฟล์ดังกล่าว หลังจากนั้นจึง save และพิมพ์ vagrant up อีกครั้ง