Our Modbus is configured as TCP Server and we configure VLAN1 (eth0.10) for Modbus server communication. We configure VLAN1 (eth0.10) for Modbus communication so that Modbus will not accept messages from other VLAN's. So we used option SO_BINDTODEVICE option in setsockopt(). But it is not solving our purpose.
Modbus server is bound to VLAN1 (eht0.10, IPaddress = 188.8.131.52). We have other VLANs also with eg: VLAN2 (eth0.11 IPaddreses 192.168.12.1). But physically only VLAN1 is connected. When we open Modscan and try to connect with IPAddress 184.108.40.206 its connecting as expected.
Then if we try to connect Modscan with IPaddress 192.168.12.1, then also Modbus server is accepting connections.
Why does the VLAN accepting connections from IPaddress of other VLAN which is not bound for it or not physically connected?