# 設定HOST的固定IP

## **修改/etc/netplan/50-cloud-init.yaml(範例設定)**<br>

```
network:
    ethernets:
      enp0s3:
        addresses: [203.68.102.99/24]
        gateway4: 203.68.102.254
        nameservers:
          addresses: [8.8.8.8,8.8.4.4]
        dhcp4: no
        optional: true

    version: 2

```

### **sudo netplan try**

**這個命令執行後會檢查設定檔格式，如果正確的話就會套用，並且在 120 秒以後自動還原設定**<br>

### **sudo netplan apply**

**測試沒有問題，就可以執行上面命令真正進行設定**<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/docker-cong-an-zhuang-dao-ying-yong-ru-men-pian/she-ding-host-de-gu-ding-ip.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
