[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to address hosts in dual ethernet networks?



On Oct 2, 2012, at 3:07 PM, Robert Latest <boblatest@gmail.com> wrote:

> Hello all,
> 
> I'm planning on setting up a small linux PC in an industrial
> environment. The PC will act as a bridge between a string of
> Ethernet/Modbus devices and a database server. It will run a very
> simple application that queries the Modbus devices and relays its
> findings to the database. The PC will have two ethernet ports: One
> connected to the Modbus devices, the other to the company's intranet.
> One port will be assigned an IP address from the intranet's DHCP
> server, and the Modbus devices will be assigned addresses in the
> 192.168 range using a DHCP server on my PC.
> 
> So far, very simple.
> 
> What I can't figure out is how to separate the IP address spaces in
> this PC itself. There are plenty of 192.168 addresses in use in our
> intranet, and it is quite possible that addresses will be used both in
> the Intranet and in the Modbus space.
> 
> Suppose the application wants to talk to the Modbus device
> 192.168.0.101 on eth1 (where the Modbus devices are connected). How
> can I prevent it from connecting to a host on the intranet that
> happens to have the same address?
> 
> Actually, I know that the hosts that I need to connect to on the
> intranet do not have 192.168.... addresses. So I suppose I can set up
> the routing table using a network mask or something of the sort. But
> what if, hypothetically, I do need to connect to an intranet host
> whose IP address happens to be used by a Modbus device as well?
> 
> Thanks,
> robert
> 
> 


The network design at your place seems like a mess and the best advice 
I can give you is to clean that up BEFORE you do anything else.

The devices on your modbus should be assign a unique IP address which 
MUST NOT overlap with any other range already in use at your place.
Lets assume you assign them 192.168.66.0 / 24 and you also assign your
PC an address in that range, then it will be automatically be routed based
on the subnet. There is no need for static routes then.

I assume that the address you get on the other ethernet port includes an 
default route (gateway). So anything not in your modbus space and in your
locally assigned space will be sent there and the router should have the 
information how to forward this package to the correct host/network.


--
Henning


Reply to: