# Ubuntu 网卡配置为静态方法

### Ubuntu 网卡配置为静态方法

> 比如网卡名字 \*\* ens160 \*\*

```bash
# 原配置 dncp
wang@1:~$ more /etc/netplan/00-installer-config.yaml.bak 
network:
  ethernets:
    ens160:
      dhcp4: true
  version: 2
```

```bash
# 静态方法
wang@1:~$ more /etc/netplan/00-installer-config.yaml


network:
  ethernets:
    ens160:
      dhcp4: no
      addresses: [10.10.194.247/24]
      gateway4: 10.10.194.254
      nameservers:
        addresses: [8.8.8.8,8.8.4.4]
  version: 2
```


---

# 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://close.gitbook.io/yun-wei-bi-ji/ubuntu/ubuntu-wang-ka-pei-zhi-wei-jing-tai-fang-fa.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.
