Update networking settings

This commit is contained in:
wmcheng 2020-03-01 18:26:56 +08:00
parent d1b5210555
commit 235d2edbf1
1 changed files with 33 additions and 1 deletions

View File

@ -494,10 +494,42 @@ esac
```
```txt
# 附註 rc.local1
# 附註 rc.local
#! /bin/sh
sudo mongod --config /etc/mongod.conf &
exit 0
```
```
### 五、網路設定
```sh
# 開機網站自動起始
$ sudo vim /etc/netplan/50-cloud-init.yaml # 內容見附註 50-cloud-init.yaml 18.04開始設定改這
#
```
```txt
# 50-cloud-init.yaml
# 本範例有兩塊網卡第一塊是DHCP第二塊是固定IP
# 其中因為子網路遮罩為255.255.255.0 ,所以是 /24
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s29u1u1u5:
dhcp4: true
enp6s0:
addresses:
- 192.168.1.142/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
search:
- rulingcom.com
version: 2