LoginSignup
0
0

Ubuntu Server 22.04 を Static IP にする方法

Posted at

設定ファイル

/etc/netplan/50-cloud-init.yaml : 自動生成ファイル。ユーザによる編集は非推奨。
/etc/netplan/99_config.yaml : Ubuntu公式ドキュメント例示ファイル名

設定反映

sudo netplan apply

設定ファイルの内容

network:
    version: 2
    ethernets:
        eth0:
            dhcp4: false
            addresses: [192.168.1.10/24]
            nameservers:
                addresses: [192.168.1.1, 8.8.8.8]
            routes:
              - to: default
                via: 192.168.1.1

gateway4は廃止されて、routesでデフォルトゲートウェイを選択するようになった

参考記事

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