Today is...
Thursday, August 22, 2019
Welcome to Control.com, the global online
community of automation professionals.
Featured Video...
Featured Video
Watch an animation of a conveyor stacking operation demonstrating the use of a move on a gear command.
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive
VLAN Issue in Modbus Communication
Modbus TCP server bound to a VLAN, but accepting connections from other VLAN IP addresses which are not physically connected.

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