適当なので(特に)IPv6周りは自信がないです。
/etc/network/interfaces
デバイス名 | 説明 |
---|---|
lo | loopback |
eth0 | NIC1 |
最近のsystemdでは、従来のeth0
のような命名ではなく、enp0s1
のような予測可能なネットワークインタフェース名を用います。
DHCP
#loopback auto lo iface lo inet loopback #eth0 DHCP auto eth0 iface eth0 inet dhcp iface eth0 inet6 auto privext 2
IPv6のDHCPは正直よくわからない。
こちらの記事ではauto
とdhcp
を両方設定している。
Static
構成は以下を仮定
IPv4 | IPv6 | |
---|---|---|
PC | 192.168.1.100/24 | xxxx:xxxx:xxxx:xxxx::100/128 |
ルータ(gateway) | 192.168.1.1 | fe80::1 |
DNS1(ルータ) | 192.168.1.1 | fe80::1 |
DNS2(Google Public DNS) | 8.8.8.8 | 2001:4860:4860::8888 |
#loopback auto lo iface lo inet loopback #eth0 auto eth0 iface eth0 inet static address 192.168.1.100/24 gateway 192.168.1.1 dns-nameservers 192.168.1.1 8.8.8.8 dns-search hoge.org iface eth0 inet6 static address 2001:xxxx:xxxx:xxxx::100/128 gateway fe80::1 dns-nameservers fe80::1 2001:4860:4860::8888 autoconf 0 accept_ra 0
dns-*
周りはresolvconf
パッケージのmanを見ましょう。
IPv6 Enable/Disable
IPv6の有効化/無効化
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
0
で有効化
1
で無効化