5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Ubuntuでネットワークが繋がらなくなったトラブルを解決した際のメモ

Posted at

概要

先日Ubuntu 20.04LTSにて、突然ネットワークが繋がらなくなったことがありました。
試行錯誤し解決したので、その際のメモ書きです。

対象の環境

MacBookPro(2021)上で動く、UTMという仮想化ソフトウェア上に構築されたUbuntu 20.04LTSです。

発生した事象

少し前にプライベートのMBPに当該環境を構築しました。環境構築後にしばらく触る機会がなく放置していたのですが、先日思い出して立ち上げたところ、ネットワークに繋がらなくなってしまっていました。

解決法

$ ip l

でネットワークデバイスの一覧を取得します。

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 8e:a1:ce:b5:02:5f brd ff:ff:ff:ff:ff:ff
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:42:bd:cf:a8:4d brd ff:ff:ff:ff:ff:ff

と、3つのデバイスが存在することが確認できました。
とりあえずこれらのデバイスの名前をメモっておきます。

次に、

$ ls /etc/netplan

として/etc/netplanの設定ファイルを確認します。

00-installer-config.yaml

という設定ファイルの存在が確認できましたので、とりあえず

$ cat /etc/netplan/00-installer-config.yaml

として中身を覗いてみます。

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp0s11:
      dhcp4: true
  version: 2

おや、設定された名前enp0s11が先ほど確認したものenp0s10と異なりますね。何かの拍子に名前が変わってしまったのでしょうか。

$ sudo vim /etc/netplan/00-installer-config.yaml

として任意のエディタ(e.g. vim)で当該ファイルを開きます。この際、sudoを付ける必要があります。
設定値(enp0s11)を先ほど確認したもの(enp0s10)に書き換えたら保存します。

Ubuntuを再起動したところ、無事ネットワークに接続できるようになっていました。

参考資料

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?