This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Handbuch:Alpha/Netzwerk/Einführung

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:Alpha/Networking/Introduction and the translation is 100% complete.
Alpha 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


Erste Schritte

This networking guide presumes that the user has correctly configured the system and has determined the hardware's network interface name(s). The network interface name is produced based on the bus location of the network card(s) in the system. Because of this there is potential for interface name variants including: eno0, ens1, wlan0, enp1s0, etc. Each system may have a slightly different interface name. The following content presumes the name of the interface to configured is eth0, although any of the aforementioned names will work.

Um mit der Konfiguration der Netzwerkkarte zu beginnen, geben Sie dem Gentoo RC System über sie Bescheid. Dies geschieht im Verzeichnis /etc/init.d dadurch die Erzeugung eines symbolischen Links auf net.lo mit dem Namen net.eth0 (oder wie auch immer die Netzwerkschnittstelle auf dem System heißt).

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.

DATEI /etc/conf.d/netBeispiel-Netzwerkkonfiguration
# Für DHCP
config_eth0="dhcp"
  
# Für statisches IP mit 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"
  
# Für statisches IP mit 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"
Notiz
Wenn für eine Schnittstelle keine Konfiguration genannt ist, wird DHCP angenommen.
Notiz
CIDR steht für Classless Inter-Domain Routing. Ursprünglich wurden die IPv4 Adressen in A, B oder C eingeteilt. Das frühe Einteilungssystem sah die starke Popularität des Internets nicht voraus und befindet sich in der Gefahr, dass ihm neue eindeutige Adressen ausgehen. CIDR ist ein Adressierungsschema das es erlaubt einer IP-Adresse viele IP-Adressen zuzuordnen. Eine CIDR IP-Adresse sieht wie eine gewöhnliche IP-Adresse aus mit dem Unterschied, dass sie mit einem Schrägstrich gefolgt von einer Nummer endet (beispielsweise 192.168.0.0/16). CIDR wird in RFC 1519 beschrieben.

Nun da die Schnittstelle konfiguriert ist, können wir sie über den folgenden Befehl starten und stoppen:

root #/etc/init.d/net.eth0 start
root #/etc/init.d/net.eth0 stop
Wichtig
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
Notiz
The last rc command instructs Gentoo to start any scripts in the current runlevel that have not yet been started.