I can't find answer about how linux processes incoming packets from different VLANs, that do not belong to a subnet assigned to a VLAN.
Imagine this situation. On Linux machine with the following configuration:
- eth0.100 - assigned address from 192.168.100.0/24 subnet (eg. 192.168.100.2)
- eth0.150 - assigned address from 192.168.150.0/24 subnet (eg. 192.168.150.2)
- eth0.200 - assigned address from 192.168.200.0/24 subnet (eg. 192.168.200.2)
the address of the default gateway is 192.168.100.1 pointing to interface eth0.100
On port eth0.150 comes packet with a source address 10.0.0.100/24 addressed to the service that listens on the 192.168.150.2. The packet is processed by service (higher layer of ISO / OSI model) and new packet (response) is generated to the host 10.0.0.100. At this point the question is how the packet will be processed.
Is Linux first checks the ARP table, and if it have an entry related with 10.0.0.100 host (MAC address) send packet back by eth0.150 or first scan the routing table, and if not find any matches will send packet back by interface eth0.100 (with which it is associated default gateway)?
Could you help find correct answer?