2020年5月12日 星期二

make esxi usb installer

1.使用win10 分割兩個磁區,disk 1格式化成fat32,disk 2格式化成ntfs
2.將usb放於ubuntu 主機
#/usr/bin/syslinux /dev/sdb1
#cat /usr/lib/syslinux/mbr.bin > /dev/sdb
#mount /dev/sdb1 /usbdisk
#mv /usbdisk/isolinux.cfg /usbdisk/syslinux.cfg
#vi  /usbdisk/syslinux.cfg
內容改成 APPEND -c boot.cfg -p 1

2020年5月6日 星期三

ubuntu18相關命令

*修改ipconfig

#vi /etc/netplan/50-cloud-init.yaml
(1)DHCP
network:
    ethernets:
        enp0s3:
            addresses: []
            dhcp4: true
    version: 2
(2)固定IP
network:
    ethernets:
        enp0s3:
            addresses: [192.168.0.10/24]
            gateway4: 192.168.0.1
            nameservers:
              addresses: [8.8.8.8,8.8.4.4]
            dhcp4: no
    version: 2
(確定前測試)
#netplan try
(確定修改)
#netplan apply

*加上rc.local

1.建立rc-local.service文件
#vi /etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
#將要執行的命令寫入 /etc/rc.local
# chmod +x /etc/rc.local
# systemctl start rc-local.service

安裝 PPPoE Server 改善throughput

Install ppp
1.下載 https://download.samba.org/pub/ppp/ppp-2.4.7.tar.gz
2.#tar zxvpf ppp-2.4.7.tar.gz
   #cd ppp-2.4.7
   #./configure
   #make
   #make install
3.重新build with kernel mode
   #tar zxvpf rp-pppoe-3.13.tar.gz
   #cd rp-pppoe-3.13/src
   #./configure --enable-plugin=/ppp-2.4.7(ppp source directory)
   #make
   #make install
   #pppoe-server -h 確定有-k選項
4.設定
   (1)/etc/ppp/pppoe-server-options 內容
   require-chap
   auth
   lcp-echo-interval 10
   lcp-echo-failure 2
   ms-dns 8.8.8.8
   ms-dns 8.8.4.4
   logfile /var/log/pppd.log
 
  (2)/etc/ppp/chap-secrets    內容
  # Secrets for authentication using CHAP
  # client server secret IP addresses
  "user1" * "123456" *
 
  (3)其他網路設定
  #echo 1 > /proc/sys/net/ipv4/ip_forward
  #iptables -A POSTROUTING -t nat -s 10.10.22.0/24 -j MASQUERADE
  #sudo pppoe-server -I eth0 -L 10.10.22.1 -R 10.10.22.100 -N 100 -k