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

Handbook:Alpha/Installation/Networking/tr

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


Otomatik ağ tanıma

Belki kendiliğinden çalışır?

If the system is plugged into an Ethernet network with a DHCP server, it is very likely that the networking configuration has already been set up automatically. If so, then the many included network-aware commands on the installation CD such as ssh, scp, ping, irssi, wget, and links, among others, will work immediately.

Determine interface names

ifconfig command

If networking has been configured, the ifconfig command should list one or more network interfaces (besides lo). In the example below eth0 shows up:

root #ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:BA:8F:61:7A
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
          collisions:1984 txqueuelen:100
          RX bytes:485691215 (463.1 Mb)  TX bytes:123951388 (118.2 Mb)
          Interrupt:11 Base address:0xe800 

As a result of the shift towards predictable network interface names, the interface name on the system can be quite different from the old eth0 naming convention. Recent installation media might show regular network interfaces names like eno0, ens1, or enp5s0. Look for the interface in the ifconfig output that has an IP address related to the local network.

Tip
If no interfaces are displayed when the standard ifconfig command is used, try using the same command with the -a option. This option forces the utility to show all network interfaces detected by the system whether they be in an up or down state. If ifconfig -a produces no results then the hardware is faulty or the driver for the interface has not been loaded into the kernel. Both situations reach beyond the scope of this Handbook. Contact #gentoo for support.

ip command

As an alternative to ifconfig, the ip command can be used to determine interface names. The following example shows the output of ip addr (of another system so the information shown is different from the previous example):

root #ip addr
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether e8:40:f2:ac:25:7a brd ff:ff:ff:ff:ff:ff
    inet 10.0.20.77/22 brd 10.0.23.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::ea40:f2ff:feac:257a/64 scope link 
       valid_lft forever preferred_lft forever

The output above may be a bit more complicated to read than alternative. The interface name in the above example directly follows the number; it is eno1.

In the remainder of this document, the handbook will assume that the operating network interface is called eth0.

Seçime bağlı: Proxy (ağ geçidi) ayarlama

Eğer internete ağ geçidi kullanarak bağlanıyorsanız, doğru olarak yapılandırmanız gerekmektedir. Bu yapılandırma kolaydır, sadece bir değişken tanımlamanız gerektiği anlamına gelir.

Çoğu durumda sunucunuzun adını veya IP adresini kullanarak bir değişken tanımı yetmektedir. Örnek olarak ağ geçidimizin proxy.gentoo.org ve kullandığı portun 8080 olduğunu varsayalım.

Şimdi (HTTP ve HTTPS trafik için) bir HTTP ağ geçidi yapılandırması yapalım:

root #export http_proxy="http://proxy.gentoo.org:8080"

FTP ağ geçidi tanımı yapmak için de:

root #export ftp_proxy="ftp://proxy.gentoo.org:8080"

RSYNC ağ geçidi yapılandırması:

root #export RSYNC_PROXY="proxy.gentoo.org:8080"

Eğer bu geçitler bir kullanıcı adı ve parola istiyor ise, değişkenleri aşağıdaki şekilde tanımlayabilirsiniz:

CODE Ağ geçidi ayarlarında kullanıcı adı ve parola
http://kullanıcıadı:parola@proxy.gentoo.org:8080

Bağlantıyı test etmek

Öncelikle DNS sunucunuzu (/etc/resolv.conf dosyasında genelde tanımlı olur) ve seçtiğiniz bir siteyi pinglemeyi deneyin. Bu sayede ağ bağlantısının düzgün çalıştığından, paketlerin internete ulaştığından ve DNS çözümlemesinin gerçekleştiğinden emin olabilirsiniz.

root #ping -c 3 www.gentoo.org

Eğer bağlanabildiyseniz, bu makaleyi geçip sonraki adım olan diskleri hazırlama'ya geçebilirsiniz.

Otomatik ağ yapılandırması

If the network doesn't work immediately, some installation media allow the user to use net-setup (for regular or wireless networks), pppoe-setup (for ADSL users) or pptp (for PPTP users).

Eğer kurulum ortamınızda bu araçlar bulunmuyorsa, Elle ağ yapılandırma bölümünden devam edin.

  • Normal ethernet kullanıcıları öntanımlı seçenek olan net-setup kullanmalı
  • ADSL kullanıcıları PPP ile devam etmeli
  • PPTP kullanıcıları da PPTP kullanmalıdır

Öntanımlı seçenek: net-setup kullanmak

The simplest way to set up networking if it didn't get configured automatically is to run the net-setup script:

root #net-setup eth0

net-setup will ask some questions about the network environment. When all is done, the network connection should work. Test the network connection as stated before. If the tests are positive, congratulations! Skip the rest of this section and continue with Preparing the disks.

Eğer bağlantı halen çalışmıyorsa, Elle ağ yapılandırma bölümünden devam edin.

Alternatif: PPP kullanmak

Assuming PPPoE is needed to connect to the Internet, the installation CD (any version) has made things easier by including ppp. Use the provided pppoe-setup script to configure the connection. During the setup the Ethernet device that is connected to your ADSL modem, the username and password, the IPs of the DNS servers and if a basic firewall is needed or not will be asked.

root #pppoe-setup
root #pppoe-start

If something goes wrong, double-check that the username and password are correct by looking at etc/ppp/pap-secrets or /etc/ppp/chap-secrets and make sure to use the right Ethernet device. If the Ethernet device does not exist, the appropriate network modules need to be loaded. In that case continue with Manual network configuration as it will explain how to load the appropriate network modules there.

Bağlantı sağladıysanız, diskleri hazırlama adımına gidebilirsiniz.

Alternatif: PPTP kullanmak

If PPTP support is needed, use pptpclient which is provided by the installation CDs. But first make sure that the configuration is correct. Edit /etc/ppp/pap-secrets or /etc/ppp/chap-secrets so it contains the correct username/password combination:

root #nano -w /etc/ppp/chap-secrets

Ardından gerekli ise /etc/ppp/options.pptp dosyasını düzenleyin:

root #nano -w /etc/ppp/options.pptp

When all that is done, run pptp (along with the options that couldn't be set in options.pptp) to connect the server:

root #pptp <sunucu ip'si>

Diskleri hazırlama bölümünden devam edebilirsiniz.

Elle ağ yapılandırma

Gerekli ağ modüllerinin yüklenmesi

Kurulum CD'si başladığında, tüm donanımı tarayıp gerekli modülleri (sürücüleri) yüklemeye çalışır. Bu durum çoğu sistem için yeterlidir. Ancak bazı durumlarda otomatik olarak yüklenmeyen bazı sürücüler gerekebilir.

If net-setup or pppoe-setup failed, then it is possible that the network card wasn't found immediately. This means users may have to load the appropriate kernel modules manually.

To find out what kernel modules are provided for networking, use the ls command:

root #ls /lib/modules/`uname -r`/kernel/drivers/net

If a driver is found for the network device, use modprobe to load the kernel module. For instance, to load the pcnet32 module:

root #modprobe pcnet32

To check if the network card is now detected, use ifconfig. A detected network card would result in something like this (again, eth0 here is just an example):

root #ifconfig eth0
eth0      Link encap:Ethernet  HWaddr FE:FD:00:00:00:00  
          BROADCAST NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Eğer aşağıdaki gibi bir hata oluştuysa, aygıt bulunamamıştır:

root #ifconfig eth0
eth0: error fetching interface information: Device not found

Sistemde kullanılabilecek arayüz isimleri /sys içerisinde görülebilir:

root #ls /sys/class/net
dummy0  eth0  lo  sit0  tap0  wlan0

In the above example, 6 interfaces are found. The eth0 one is most likely the (wired) Ethernet adapter whereas wlan0 is the wireless one.

Assuming that the network card is now detected, retry net-setup or pppoe-setup again (which should work now), but for the hardcore people we explain how to configure the network manually as well.

Select one of the following sections based on your network setup:

DHCP kullanmak

DHCP (Dynamic Host Configuration Protocol) makes it possible to automatically receive networking information (IP address, netmask, broadcast address, gateway, nameservers etc.). This only works if a DHCP server is in the network (or if the ISP provider provides a DHCP service). To have a network interface receive this information automatically, use dhcpcd:

root #dhcpcd eth0

Bazı ağ yöneticileri sistemlerde DHCP sunucudan verilen makine isimlerinin kullanılmasını isteyebilir, bu durumda:

root #dhcpcd -HD eth0

Eğer işe yararsa (yaradığını anlamak için internetteki bir adresi pingleyin, Google gibi) devam etmeye hazırsınız demektir. Diskleri hazırlama adımına geçebilirsiniz.

Kablosuz bağlantı için hazırlık

Note
Support for the iw command might be architecture-specific. If the command is not available see if the net-wireless/iw package is available for the current architecture. The iw command will be unavailable unless the net-wireless/iw package has been installed.

When using a wireless (802.11) card, the wireless settings need to be configured before going any further. To see the current wireless settings on the card, one can use iw. Running iw might show something like:

root #iw dev wlp9s0 info
Interface wlp9s0
	ifindex 3
	wdev 0x1
	addr 00:00:00:00:00:00
	type managed
	wiphy 0
	channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz
	txpower 30.00 dBm

To check for a current connection:

root #iw dev wlp9s0 link
Not connected.

or

root #iw dev wlp9s0 link
Connected to 00:00:00:00:00:00 (on wlp9s0)
	SSID: GentooNode
	freq: 2462
	RX: 3279 bytes (25 packets)
	TX: 1049 bytes (7 packets)
	signal: -23 dBm
	tx bitrate: 1.0 MBit/s
Note
Some wireless cards may have a device name of wlan0 or ra0 instead of wlp9s0. Run ip link to determine the correct device name.

For most users, there are only two settings needed to connect, the ESSID (aka wireless network name) and, optionally, the WEP key.

  • First, ensure the interface is active:
root #ip link set dev wlp9s0 up
  • To connect to an open network with the name GentooNode:
root #iw dev wlp9s0 connect -w GentooNode
  • To connect with a hex WEP key, prefix the key with d::
root #iw dev wlp9s0 connect -w GentooNode key 0:d:1234123412341234abcd
  • To connect with an ASCII WEP key:
root #iw dev wlp9s0 connect -w GentooNode key 0:some-password
Note
If the wireless network is set up with WPA or WPA2, then wpa_supplicant needs to be used. For more information on configuring wireless networking in Gentoo Linux, please read the Wireless networking chapter in the Gentoo Handbook.

Confirm the wireless settings by using iw dev wlp9s0 link. Once wireless is working, continue configuring the IP level networking options as described in the next section (Understanding network terminology) or use the net-setup tool as described previously.

Ağ terminolojisini anlamak

Note
If the IP address, broadcast address, netmask and nameservers are known, then skip this subsection and continue with Using ifconfig and route.

Eğer yukardakilerin hiçbiri işe yaramazsa, elle yapılandırmanız gerekecektir. Çok zor olmasa da, bazı ağ terimlerinin bilinmesini gerektirir. Bu bölümü okuduktan sonra, kullanıcı ağ geçidinin (gateway) ne olduğunu, ağ maskesinin (netmask) ne işe yaradığını ve broadcast (yayın) adresinin nasıl oluştuğunu anlayıp, isim sunucusuna (nameserver) neden ihtiyaç duyulduğunu bilir duruma gelecektir.

Bir ağda, istemciler IP (Internet Protocol) adresleri ile tanımlanır. Şu anda yaygın olarak kullanılan IPv4 (IP sürüm 4) sistemlerde bir IP adresi 0'dan 255'e dört tane sayının kombinasyonundan oluşur. Gerçekte bir IP adresi sıfırlar ve birlerden oluşan 32 bit temsil eder. Bir örneğe bakalım:

CODE Bir IPv4 adres örneği
IP Adresi (sayılar):   192.168.0.2
IP Adresi (bitler):    11000000 10101000 00000000 00000010
                        -------- -------- -------- --------
                           192      168       0        2
Not
IPv4'ün ardından kullanılacak olan IPv6, 128 bit kullanmaktadır. Biz bu makalede IPv4 üzerine odaklanacağız.

Bir IP adresi, erişilebilen ağlar içerisinde tektir. Yani ağdaki her istemcinin/bilgisayarın adresi kendine ait olmalıdır. Ağa dahil olmayan bilgisayarların tespit edilip onlara erişim yapılabilmesi için de, bu adres ikiye bölünür: ağ bölümü ve istemci bölümü.

Bu ayrımı yapan da ağ maskesi (netmask) değeridir. Netmask değerinin bit'leri birkaç tane 1 ve toplam bit sayısını 32'ye tamamlayacak kadar 0'dan oluşur. Burdaki 1'ler ağ bölümünü, 0'lar da istemci bölümünü temsil eder. Tabi ki netmask de IP adresi gibi yazılabilir.

CODE Örnek ağ/istemci ayrımı
IP adresi:    192      168      0         2
            11000000 10101000 00000000 00000010
Netmask:    11111111 11111111 11111111 00000000
               255      255     255        0
           +--------------------------+--------+
                    Ağ                 İstemci

In other words, 192.168.0.14 is part of the example network, but 192.168.1.2 is not.

Broadcast (yayın) adresinin ise ağ kısmında adresi aynı, istemci kısmında tüm bit değerleri 1'dir. Ağdaki tüm istemciler bu IP adresini dinler, çünkü bu adresin amacı herkese ulaşacak yayınların iletilmesidir.

CODE Broadcast adresi
IP adresi:     192      168      0         2
            11000000 10101000 00000000 00000010
Broadcast:  11000000 10101000 00000000 11111111
               192      168      0        255
           +--------------------------+--------+
                     Ağ                 İstemci

Ağın dışına (yani internete) çıkabilmek için ise her bilgisayarın, ağdaki hangi istemcinin bağlantıyı dağıttığını bilmesi gerekmektedir. Bu istemci de ağ geçicidir (gateway). Normal bir istemci olduğu için, ağda normal bir adrese sahiptir (Örn. 192.168.0.1).

Her istemcinin kendine has bir IP adresi olduğundan bahsetmiştik. İstemcilere IP adresi yerine isimleri ile ulaşabilmek için, isimleri IP adresine çeviren bir servis gerekmekte. Örneğin dev.gentoo.org adresinin IP adresinin 64.5.62.82 olduğunu bilen bir servise. Bu servisin adı da "isim sunucusu"dur (DNS veya NS). Sistemin kullanacağı isim sunucularının IP adresleri /etc/resolv.conf dosyasında tanımlanmalıdır.

Genelde isim sunucusu görevini de ağ geçidi yapar. Ancak farklı bir adres ise bu dosyaya girilmelidir.

Toparlayacak olursak, devam etmeden önce bilmemiz gerekenler:

Network item Example
The system IP address 192.168.0.2
Netmask 255.255.255.0
Broadcast 192.168.0.255
Gateway 192.168.0.1
Nameserver(s) 195.130.130.5, 195.130.130.133

ifconfig ve route kullanımı

Setting up the network consists of three steps:

  1. Assign an IP address using ifconfig
  2. Set up routing to the gateway using route
  3. Finish up by placing the nameserver IPs in /etc/resolv.conf

To assign an IP address, the IP address, broadcast address and netmask are needed. Then execute the following command, substituting ${IP_ADDR} with the right IP address, ${BROADCAST} with the right broadcast address and ${NETMASK} with the right netmask:

root #ifconfig eth0 ${IP_ADRESI} broadcast ${BROADCAST} netmask ${NETMASK} up

Set up routing using route. Substitute ${GATEWAY} with the right gateway IP address:

root #route add default gw ${GATEWAY}

Ardından /etc/resolv.conf dosyasını açın:

root #nano -w /etc/resolv.conf

Fill in the nameserver(s) using the following as a template. Make sure to substitute ${NAMESERVER1} and ${NAMESERVER2} with the appropriate nameserver addresses:

CODE /etc/resolv.conf içerisindeki şablon
nameserver ${NAMESERVER1}
nameserver ${NAMESERVER2}

Tamamdır. Şimdi internetteki bir sunucuyu (google vb.) pingleyerek bağlantınızı test edin. Çalışıyor ise tebrikler. Diskleri hazırlama bölümünden devam edebilirsiniz.