Ubuntu 18.04のIP静的インターフェイスの問題

Ubuntu 18.04のIP静的インターフェイスの問題

Ubuntu 16.04では、私のインターフェースファイルには次の情報が含まれています。

sudo nano /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# Public Interface (Static IP)
auto enp2s0
iface enp2s0 inet static
   address 192.168.88.13
   gateway 192.168.88.1 
   netmask 255.255.255.0
   broadcast 192.168.88.255
   dns-nameservers 8.8.8.8 8.8.4.4
   dns-search 8.8.8.8 8.8.4.4
   dns-domain 8.8.8.8 8.8.4.4

# Local Network Interface (Static IP)
auto enp2s1
iface enp2s1 inet static
   address 192.168.0.10
   netmask 255.255.255.0
   broadcast 192.168.0.255
   network 192.168.0.0

うまくいきます。 Ubuntu 18.04が更新され、enp2s0が機能しません(最初のインターフェイスを公開)。

ifconfig

enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.88.13  netmask 255.255.255.0  broadcast 192.168.88.255
        ether 94:18:82:0c:00:01  txqueuelen 1000  (Ethernet)
        RX packets 570  bytes 53571 (53.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 79  bytes 11201 (11.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  

DHCPのみ:

auto enp2s0
iface enp2s0 inet dhcp

新しいバージョンでは以前の構成は許可されません。何が変わりましたか?ありがとう

ベストアンサー1

新しくインストールされたUbuntu 18サーバーでは、Ubuntu 16サーバーで使用したのと同じネットワーク構成を/ etc / network / interfacesで使用でき、機能します。次のようにします。

  1. sudo apt install ifupdown
  2. /etc/network/interfaces ファイルを編集します。
  3. cd /etc/netplan/それからmv 50-cloud-init.yaml 50-cloud-init.yaml.old
  4. DNS 設定: vi /etc/systemd/resolved.conf [対処] DNS=4.2.2.2 8.8.8.8 または DNS サーバ IP

Ubuntu 16サーバーからUbuntu 18サーバーへのアップデートにも当てはまるようです。

おすすめ記事