0
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.

netplan

Posted at

ubuntuでは結構厄介なものがあります。
それはnetplan
自分これまでvpsでnet-toolsに頼りっぱなしだったので、
職場で恥をかいちゃいました。

#実際はnic(インターフェース)に空白がないので、誤解しないようお願いします
ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 02:02:a0:fb:0c:47 brd ff:ff:ff:ff:ff:ff
    inet 160.251.12.71/23 brd 160.251.13.255 scope global dynamic eth0
       valid_lft 5183552sec preferred_lft 5183552sec
    inet6 fe80::2:a0ff:fefb:c47/64 scope link
       valid_lft forever preferred_lft forever

まず下記はインタフェイスです。
合計二つあります。loはlocalの意味です。
lo:
eth0:

続いては以下。

00-installer-config.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
    ens160:
      dhcp4: false
      addresses:
        - 172.16.0.100/24
      gateway4: 172.16.0.1
      nameservers:
        addresses: [172.16.0.1,8.8.8.8]

IPv4アドレス 172.16.0.100
サブネットマスク 255.255.255.0 ( /24 )
デフォルトゲートウェイ 172.16.0.1
DNS 172.16.0.1 , 8.8.8.8

ちなみになれないで練習すると、間違ったらssh接続できなくなります。
マジで気をつけてください。

0
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
0
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?