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 = 220.127.116.11). 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 18.104.22.168 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?