Let's suppose that I have 2 ipvlan mode l2 network interfaces: A and B, and A is in a network namespace.
When B receives a packet, is it possible to distinguish in a netfilter (iptables) rule whether the packet has come from the same host (i.e. from A), without hardcoding the IP address of A?
Is it possible for a malicious host on the local network to do some ARP attack, and take over the IP address of A, thus when B receives a packet from the IP address of A, the packet may come from the malicious host?
I need this for setting up netfilter rules to allow traffic from A to B (port X), but to disallow traffic from other hosts on the local network to B (same port X). Thus I want to distinguish A from other hosts on the local network.