Help us understand the problem. What is going on with this article?

Ubuntu 17.10でのIPアドレス変更(固定IPアドレス)

More than 1 year has passed since last update.

17.10から、IPアドレスの変更が/etc/network/interfacesを弄る方式から変わったようなので、メモとして残しておきます。

interfaceの確認

ifconfigもしくはip addrを実行して変更対象のinterface名を確認しておきます

root@localhost:~# ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

IPアドレス変更

/etc/netplan/01-netcfg.yamlを開き、後はお好みでIPアドレスを変更していきます。以下は設定例になります

root@localhost:~# 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:
    eno1:
      dhcp4: no
      addresses: [192.168.1.3/24]
      gateway4: 192.168.11.1
      nameservers:
        addresses: [192.168.11.1,192.168.11.2]
      dhcp6: no

IPアドレス変更の反映

netplan applyを実行して反映して完了です。再起動までは必要ないです

root@localhost:~# netplan apply

参考

Configuring Static IP Addresses on Ubuntu 17.10 Servers – Website for Students

shivase
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした