ハンドブック:SPARC/インストール/導入

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:SPARC/Networking/Introduction and the translation is 100% complete.
SPARC ハンドブック
インストール
インストールについて
メディアの選択
ネットワーク設定
ディスクの準備
stage ファイル
ベースシステムのインストール
カーネルの設定
システムの設定
ツールのインストール
ブートローダの設定
締めくくり
Gentoo の操作
Portage について
USE フラグ
Portage の機能
Init スクリプトシステム
環境変数
Portage の操作
ファイルとディレクトリ
変数
ソフトウェアブランチの併用
追加ツール
カスタムパッケージリポジトリ
高度な機能
OpenRC ネットワーク設定
はじめに
高度な設定
モジュール式ネットワーク
無線
機能の追加
動的な管理


以降のハンドブックのネットワークに関する部分は、OpenRC init システムを実行していて、ネットワーク管理システムとして netifrc を利用しているシステムのために、「高度な」ネットワーク設定について記述しています。

systemd を実行しているシステムについては、systemd の記事のネットワークの箇所を確認すべきです。

Netifrc is a simple framework for configuring and managing network interfaces on OpenRC based systems. sys-apps/openrc pulls net-misc/netifrc automatically, as the netifrc USE flag is enabled by default.

Creating an interface init script

In order to manage an interface with netifrc, an init script for that interface must be created. By default, netifrc installs /etc/init.d/net.lo, which can be symlinked to create init scripts for new interfaces.

To create a new init script for interface eth0, simply symlink the default net.lo script:

root /etc/init.d #ln -s net.lo net.eth0
ヒント
Interface names can be determined by running ip link show (ip l for short) or ls /sys/class/net.
重要
Interface names will differ from system to system. Kernel based device names starting with eth<n> or wlan<n> may differ by index across boots. udev may set interface names starting with wlp or enp, where these names are persistent across reboots.

Configuring netifrc interfaces

Ethernet interfaces will often work without any additional config, as netifrc will automatically use DHCP for interfaces with no specified config.

If additional configuration is needed, for options such as static IPs, /etc/conf.d/net can be edited:

ファイル /etc/conf.d/netSetting a static IP for eth0.
# For static IP using CIDR notation
config_eth0="192.168.0.7/24"
routes_eth0="default via 192.168.0.1"
dns_servers_eth0="192.168.0.1 8.8.8.8"
</div>

<div lang="en" dir="ltr" class="mw-content-ltr">
# For static IP using netmask notation
config_eth0="192.168.0.7 netmask 255.255.255.0"
routes_eth0="default via 192.168.0.1"
dns_servers_eth0="192.168.0.1 8.8.8.8"
メモ
If no configuration is specified for an interface, DHCP is used.

Netifrc interface service management

With the interface init scripts created and configured, netifrc services can be managed using rc-service. To start eth0:

root #rc-service net.eth0 start
重要
ネットワークのトラブルシューティングをするときは、/var/log/rc.log を見てください。/etc/rc.conf 内で rc_logger 変数を NO に設定していなければ、ブート試行についての情報がこのログファイルに保存されるでしょう。

To start eth0 automatically at startup, it can be added to the default runlevel:

root #rc-update add net.eth0 default
root #rc