ネットワークインターフェースの追加
Debian 12 bookworm
もっとも原始的な設定の場合
/etc/network/interfaces に設定が書かれる。
/etc/network/interfaces.d/* からも読み込まれるようになっているので、変動するような設定はここに書いた方がよさげ。
デフォルトでの設定では以下のように作られた。(Hyper-V に ISO からのインストール)
code:/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
IPv4 で固定アドレスを設定する例
code:interfaces
iface enp1s0 inet static
address 192.0.2.2
network 192.0.2.0
netmask 255.255.255.0
gateway 192.0.2.1
dns-nameservers 8.8.8.8 1.1.1.1
dns-nameservers は本当はISPなどのDNSサーバーを設定すべき。