How packets are forwarded between interfaces

2

I have problems with understanding this topic.

I understand iptables packet flow as well as well as kernel hooks.

Do not take into account iptables rules, just net.ipv4.ip_forward enabled and iptables empty.

Consider host with two NICs. First is in 192.168.0.0/24 network, second - 10.10.0.0/24. Packet comes to the first NIC with IP 10.10.0.3.

My question is how kernel determines where to route packet ? Does it just check routing table and thats all ? If it finds routing entry that corresponds to this address than it takes NIC name and forwards this packet to the specific NIC ? Which is stored in /proc/net/route but really in the kernel RAM ? But if there is no such route it checks NIC(interfaces) that maybe one of them has specific IP even with network route entry in the table ?

Am I right ?

fyfdzbgz

Posted 2016-10-31T07:38:53.593

Reputation: 21

No answers