# Ubuntu18.04:Netplanによるネットワーク設定

**URL:** https://forum.ficusonline.com/t/topic/315
**Category:** Server
**Created:** [2019 年 8 月 6 日午後 1:57 UTC](https://forum.ficusonline.com/t/topic/315 "2019-08-06T13:57:33Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2019 年 8 月 7 日午前 2:00 UTC](https://forum.ficusonline.com/t/topic/315/2 "2019-08-07T02:00:09Z")

</div>

**Netplanの設定例 /etc/netplan/xxx.yaml**

[https://netplan.io/examples](https://netplan.io/examples)

[Introduction - Netplan documentation](https://netplan.readthedocs.io/en/stable/examples/)

**NetworkManagerによる設定を使用（Ubuntu18.04のデフォルト）**

```auto
network:
  version: 2
  renderer: NetworkManager

```

NetworkManagerのcliで設定

```auto
$ sudo nmtui

```

**DHCPによるIPアドレス付与+マルチインターフェイス**

```auto
network:
  version: 2
  ethernets:
    enred:
      dhcp4: yes
      dhcp4-overrides:
        route-metric: 100
    engreen:
      dhcp4: yes
      dhcp4-overrides:
        route-metric: 200

```

**WPA（パーソナル）ワイヤレス・ネットワーク**

```auto
network:
  version: 2
  renderer: networkd
  wifis:
    wlp2s0b1:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.0.21/24]
      nameservers:
        addresses: [192.168.0.1, 8.8.8.8]
      access-points:
        "network_ssid_name":
          password: " **********"
      routes:
          - to: default
            via: 192.168.0.1

```

**シングルインターフェイスにマルチアドレス付与**

```auto
network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
     addresses:
       - 10.100.1.38/24
       - 10.100.1.39/24
     routes:
       - to: default
         via: 10.100.1.1

```

---

_[View the full topic](https://forum.ficusonline.com/t/topic/315)._
