Gentoo Logo

Disclaimer : Questo manuale è stato sostituito da una nuova versione e non è più mantenuto.


[ << ] [ < ] [ Home ] [ > ] [ >> ]


1. Configurazione comune

1.a. Getting started

Nota: This document assumes that you have correctly configured your kernel, its modules for your hardware and you know the interface name of your hardware. We also assume that you are configuring eth0, but it could also be eno0, ens1, wlan0, enp1s0 etc.

To get started configuring your network card, you need to tell the Gentoo RC system about it. This is done by creating a symbolic link from net.lo to net.eth0 (or whatever the network interface name is on your system) in /etc/init.d.

Codice 1.1: Symlinking net.eth0 to net.lo

# cd /etc/init.d
# 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. Below is a sample configuration for DHCP and static addresses.

Codice 1.2: Examples for /etc/conf.d/net

# For DHCP
config_eth0="dhcp"

# 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"

# 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"

Nota: If you do not specify a configuration for your interface then DHCP is assumed.

Nota: 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 we have configured our interface, we can start and stop it using the following commands:

Codice 1.3: Starting and stopping network scripts

# /etc/init.d/net.eth0 start
# /etc/init.d/net.eth0 stop

Importante: When troubleshooting networking, take a look at /var/log/rc.log. Unless you have rc_logger="NO" set in /etc/rc.conf, you will find information on the boot activity stored in that log file.

Now that you have successfully started and stopped your network interface, you may wish to get it to start when Gentoo boots. Here's how to do this. The last "rc" command instructs Gentoo to start any scripts in the current runlevel that have not yet been started.

Codice 1.4: Configuring a network interface to load at boot time

# rc-update add net.eth0 default
# rc

[ << ] [ < ] [ Home ] [ > ] [ >> ]


Stampa

Visualizza tutto

Aggiornato il 6 maggio 2013

Questa traduzione non è più mantenuta

Oggetto: La guida più rapida per far funzionare la propria connessione di rete nella maggior parte dei casi.

Sven Vermeulen
Autore

Roy Marples
Autore

Daniel Robbins
Autore

Chris Houser
Autore

Jerry Alexandratos
Autore

Seemant Kulleen
Sviluppo x86

Tavis Ormandy
Sviluppo Alpha

Jason Huebel
Sviluppo AMD64

Guy Martin
Sviluppo HPPA

Pieter Van den Abeele
Sviluppo PPC

Joe Kallar
Sviluppo SPARC

John P. Davis
Redazione

Pierre-Henri Jondot
Redazione

Eric Stockbridge
Redazione

Rajiv Manglani
Redazione

Jungmin Seo
Redazione

Stoyan Zhekov
Redazione

Jared Hudson
Redazione

Colin Morey
Redazione

Jorge Paulo
Redazione

Carl Anderson
Redazione

Jon Portnoy
Redazione

Zack Gilburd
Redazione

Jack Morgan
Redazione

Benny Chuang
Redazione

Erwin
Redazione

Joshua Kinard
Redazione

Tobias Scherbaum
Redazione

Lars Weiler
Redazione

Jochen Maes
Redazione

Grant Goodyear
Revisione

Gerald J. Normandin Jr.
Revisione

Donnie Berkholz
Revisione

Ken Nowack
Revisione

Marco Mascherpa
Traduzione

Stefano Rossi
Traduzione

Enrico Morelli
Traduzione

Donate to support our development efforts.

Copyright 2001-2014 Gentoo Foundation, Inc. Questions, Comments? Contact us.