# Temel Ağ Yönetimi

## Temel Ağ Bileşenleri ve IP Komutu

**IP Adresi:** Ağa bağlanan her bilgisayarın bir IP adresine sahip olması gerekir. DHCP sunucusu ağa bağlanan her bilgisayarın farklı ve özgün bir IP adresine sahip olmasını sağlar. \
**Gateway Adresi:** Eğer bilgisayarların bağlı bulunduğu ağın internet bağlantısı var ise ağda bulunup internete bağlanacak olan bilgisayarların bir gateway(geçit) IP adresine sahip olması gerekir.\
**DNS Adresi** : Bir ağ için en az bir, tercihen iki adet DNS IP adresinin önceden belirlenmiş olması gerekir. DNS IP adresi , ağdaki bir bilgisayar için name resolving işlemi yapacak olan sunucunun IP adresidir.\
**Netmask Adresi:**  İki cihaz veya bilgisayarın aynı ağda olup olmadıklarını kullandıkları ağ alt maskeleri belirler. Ağ alt maskesi IP adresinin ilk 24 bitine karşı gelen kısımdır. Ağa bağlı her ethernet kartı için bir ağ alt maskesi bulunmalıdır.

Terminal üzerinde ip bilgilerimizi görmek için aşağıdaki komutu çalıştırırız

```
kullanici@sunucu$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether e0:d5:5e:80:13:96 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 192.168.5.5/24 brd 192.168.5.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::1397:4d7b:45c:6721/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff

```

Bilgisayardaki ağların gateway adreslerini bulmak için aşağıdaki komut çalıştırılır.

```
kullanici@sunucu$ ip route
default via 192.168.5.1 dev eno1 proto static metric 100 
169.254.0.0/16 dev eno1 scope link metric 1000 
192.168.5.0/24 dev eno1 proto kernel scope link src 192.168.5.5 metric 100 

```

**DNS Sunucusu**

![](/files/-Miy87Cw01sSF5wZWFaS)

**DHCP Sunucusu**

![](/files/-Miy8LDZtY44V06yLsEA)

## Ağ ile İlgili Temel Dosyalar

Network ayarları aşağıdaki dosya ve dizinlerde bulunur.

* /etc/hosts
* /etc/resolv.conf
* /etc/network/interfaces

## Ağ Türleri

### Bridge (Köprü Bağdaştırıcısı)

![](/files/-MiXTCRIe3AXOryCMgat)

### NAT

![](/files/-MiXT5_IkS7I0eEVbQr9)

### Nat Network

![](/files/-MiXTstD1i4E1iP5ZVHS)

## Ağ Üzerinde Bilgi Toplama

### ping&#x20;

Bir adresi kontrol etmek için ping komutu kullanılır.

```
ping <adres>
ping -c <adres>
```

### telnet

Uzaktaki makineye telnet protokolü ile bağlanmak için telnet komutu kullanılır.

```
telnet <adres> <port>
```

### traceroute

Bir adrese erişim için kullanılan yol ile ilgili bilgi almak için traceroute komutu kullanılır.

```
traceroute <adres>
```

### nslookup

Bir alan adına bağlı IP adresini veya bir IP adresine bağlı alan adını araştırır.

```
nslookup github.com 8.8.8.8
```

### dig

```
dig github.com
```

### host

```
host github.com
```

### nmap

Belirli bir ağı keşfetmek için kullanılır.

```
nmap 192.168.5.5
Starting Nmap 7.80 ( https://nmap.org ) at 2020-07-07 16:01 +03
Nmap scan report for sunucu (192.168.5.5)
Host is up (0.0000030s latency).
Not shown: 993 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
3389/tcp open  ms-wbt-server
7070/tcp open  realserver

Nmap done: 1 IP address (1 host up) scanned in 0.27 seconds
```

### ss

Mevcut makine üzerindeki soketleri dinlemek için kullanlır. Örneğin TCP bağlantılarını dinlemek için

```
ss -ant
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.liman.dev/sistem-yonetimi/temel-ag-yo-netimi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
