# İki NIC Arasında Port Yönlendirme

Paketlerin kernel tarafından yönlendirilmesini aktifleştirmek için;

```
# echo 1 > /proc/sys/net/ipv4/ip_forward
```

Yada aşağıdaki komut da eşdeğerdir,

```
net.ipv4.ip_forward = 1
```

Aşağıdaki komut ile eth0 interfacenin belirlenen ip'nin belirlenen portuna gelen trafiği diğer nic'de bulunan (yani private olan nic'in)dinamik nat ile belirlenen ip'nin belirnen portuna trafik yönlendirilecektir.

`iptables -t nat -A PREROUTING -i eth0 -d 178.128.243.215 -p tcp --dport 8001 -j DNAT --to-destination 10.8.0.2:8001`

Aşağıdaki komutla tüm kurallar listelenebilir.

```
iptables -t nat -L -n -v
```


---

# 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://security.musana.net/linux/iki-nic-arasinda-port-yoenlendirme.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.
