---
# System prepended metadata

title: netplanでのネットワーク設定

---

# netplanでのネットワーク設定
/etc/netplan/01-netcfg.yamlを編集
```
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens2:
      dhcp4: no
      addresses: [192.168.30.91/16]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [8.8.8.8, 192.168.0.1, 192.168.1.1]
    ens10:
      addresses: ["0000:006B:0340:004C:1200:1400:0800:0000/68"]
      gateway6: "0000:006B:0340:004C:1200:1400:0D00:0000"
```
以下で適用
```
netplan apply
```