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

From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page Handbook:AMD64/Networking/Introduction and the translation is 100% complete.

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎日本語 • ‎한국어 • ‎polski • ‎русский • ‎українська • ‎中文(中国大陆)‎
AMD64 Handbook
Installation
About the installation
Choosing the media
Configuring the network
Preparing the disks
Installing stage3
Installing base system
Configuring the kernel
Configuring the system
Installing tools
Configuring the bootloader
Finalizing
Working with Gentoo
Portage introduction
USE flags
Portage features
Initscript system
Environment variables
Working with Portage
Files and directories
Variables
Mixing software branches
Additional tools
Custom package repository
Advanced features
Network configuration
Getting started
Advanced configuration
Modular networking
Wireless
Adding functionality
Dynamic management


はじめに

Note
このドキュメントは、ユーザーが正しくシステムのカーネルとハードウェアを設定し、ハードウェアのインターフェース名を知っていることを前提にしています。また、設定するインターフェースがeth0であるとも仮定していますが、これはあくまで例であり、実際にはeno0、ens1、wlan0、enp1s0などであるかもしれません。

ネットワークカードの設定を始めるなら、まずGentooのRCシステムにそのことを伝えましょう。これは、net.lo から net.eth0 (もしくは他の、システム上のネットワークインターフェース名)へのシンボリックリンクを /etc/init.d に作成することで行うことができます。

root #cd /etc/init.d
root #ln -s net.lo net.eth0

Gentoo's RC system now knows about that interface. It also needs to know how to configure the new interface. All the network interfaces are configured in /etc/conf.d/net file. Below is a sample configuration for DHCP and static addresses.

FILE /etc/conf.d/netネットワーク設定の例
# DHCPを使う場合
config_eth0="dhcp"
  
# CIDR記法で静的IPを設定する場合
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"
  
# ネットマスクによる記法で静的IPを設定する場合
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"
Note
If no configuration is mentioned for an interface then DHCP is assumed.
Note
CIDR stands for Classless InterDomain Routing. Originally, IPv4 addresses were classified as A, B, or C. The early classification system did not envision the massive popularity of the Internet, and is in danger of running out of new unique addresses. CIDR is an addressing scheme that allows one IP address to designate many IP addresses. A CIDR IP address looks like a normal IP address except that it ends with a slash followed by a number; for example, 192.168.0.0/16. CIDR is described in RFC 1519.

Now that the interface is configured, we can start and stop it using the following commands:

root #/etc/init.d/net.eth0 start
root #/etc/init.d/net.eth0 stop
Important
When troubleshooting networking, take a look at /var/log/rc.log. Unless the rc_logger variable is set to NO in /etc/rc.conf, information on the boot activity will be stored in that log file.

Now that the network interface has been successfully stopped and started, the next step is to have it started when Gentoo boots. Here is how to do this.:

root #rc-update add net.eth0 default
root #rc
Note
The last rc command instructs Gentoo to start any scripts in the current runlevel that have not yet been started.