2017年9月2日土曜日

Ubuntu 17.10のネットワーク設定がifupdownからnetplanに変更になったでござる

Ryzen 7を入手したので、Ubuntu Server 17.10のdaily buildでいろいろ試していたところ、
/etc/network/interfacesで固定IPが設定できなくなっていたので、
netplanの設定方法を確認した。

参考

https://insights.ubuntu.com/2017/07/10/netplan-by-default-in-17-10/
https://git.launchpad.net/netplan/tree/doc/netplan.md

インストール直後の設定

cat /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:
    enp38s0:
      dhcp4: yes
      dhcp6: yes
マニュアルを参考にして、定義ファイルを書き換え
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    enp38s0:
      dhcp4: no
      addresses: [192.168.100.10/24]
      gateway4: 192.168.100.1
      nameservers:
        addresses: [8.8.8.8]
      dhcp6: no
上記の設定のみでは反映されなかったので、以下のファイルを作成した。
sudo mkdir /etc/network/interfaces.d
sudo touch /etc/network/interfaces.d/enp38s0
再起動したところ固定IPアドレスが反映されました。
このあたりは、Ubuntu 18.04 LTSがリリースされてから再度調べてみる。

しかし、Ryzen 7いいですね。