TirithRR the Eccentric wrote:
There is a machine where I work that was setup by an OEM years before I got there. It uses ethernet to communicate between it's various pieces. The instruction manual for the devices used gave an example of how to setup the network, and it used the following IP addresses: 184.108.40.206, .2, and .3, with a subnet mask of 255.255.0.0
I don't understand why the manual for this used the 130.130.130 addresses. My IT guy doesn't understand either, since they aren't private IP ranges.
The factory networks use 10.0.0.XXX and we had to build a gateway between the two networks to pass information from the machine to computers on our network.
Now comes the strange part. The machine had two windows computers running some HMI software on them and a controller with a network interface. Configuring the two windows PCs wasn't a problem. IP Address 220.127.116.11, Subnet Mask 255.255.0.0, and the Gateway of 10.0.0.227. Windows accepted this setup without a problem. The network interface on the controller refused to accept the combination, saying that the Gateway address was invalid. Turns out that the result of the IP Address and Mask and the Gateway Address and Mask have to match. So I had to modify the Mask to 18.104.22.168 for it to work. (Masking 130.130 with 191.125 and 10.0 with 191.125 result in the same answer).
Now, a lot of the details are over my head, but the way I understood it is the Subnet Mask set up which IP address the device could talk to, using a Logical AND with the binary octets. Makes sense that the controller, with an IP of 130.130.x.x and a mask of 255.255.0.0 would only be able to talk to 130.130.x.x and therefor refused to talk to, or even accept, the 10.0.0.227 gateway. But why did the Windows Computers accept and use the gateway with the same IP and Mask combination?
Because windows is stupid sometimes (most of the time?), and allowed an incorrect address scheme. Although to be fair, most systems will allow you to enter values which may not work properly. Your understanding of the netmask process is correct. The netmask establishes whether a range of addresses are "local" or "remote". Specifically, a local address is one which your interface can speak to directly. There is no router in between them. Everything else is remote. If the address you're communicating with is within the netmask range of your own address, it'll simply broadcast the signal through the NIC and wait for a response from the other computer. If it is deemed to be non-local, it'll send a connection request to the router/gateway address instead. That router will use it's own tables to figure out how to route the packets from/to the other computer, and enable longer distance communication.
It's usually a good idea to use private net addresses unless you actually own the IP address range in question. I'm not sure why 130.130.130.x is given as an example. It's not a range I would use. That address range appears to belong to a university in Australia, so unless you work at "uow.edu.au", I'd pick other addresses. Anything in the 10.x.x.x or anything in the 192.168.x.x ranges are commonly used for private net addresses and wont get you into any trouble. Of course, all of this assumes that you are setting up a private network and that the systems aren't expected to communicate to anything other than themselves.
Pick a smaller netmask. If you've got a device with a network connection to your lan, and another one to a switch with 3 other systems attached (so they can only speak to eachother and the main system), why use a large netmask? Use 255.255.255.0 in most cases. That gives you 254 addressees in that range. Probably far far more than you actually need. It'll also simplify the work.
Since the factory network (I'm assuming that's your lan) is set up on 10.0.0.x, you're presumably using the one system as a gateway, correct? The Windows boxes on that smaller private network should *not* use the same gateway as the factory network. They don't have a direct network connection to that network, only to the primary system. It should have two interfaces, one on the factory network, and one on the smaller private network (the factory network is also private, so I don't want to confuse the two). The secondary network interface on the first system should perhaps be set to 192.168.0.1, with a netmask of 255.255.255.0. It's primary interface should be the 10.0.0.x address with a 10.0.0.1 gateway (or whatever you're using on the factory floor), and whatever netmask is used on the factory network. The two windows boxes should be set to 192.168.0.2 and .3 respectively, with netmasks of 255.255.255.0, and a gateway of 192.168.0.1 (the secondary interface of the primary machine).
If the primary system is being used as a router, you'll need to configure it that way. This usually involves turning on certain services on the secondary interface. I guess that all depends on whether other systems on the network need to talk to those windows boxes. That wasn't clear. I know that a lot of vendor equipment involves the use of multiple computers, all of which need to talk to eachother, but none of which need to speak to a broader network (except one of them of course). We have tester computers with a private network on each (set up more or less exactly as I just indicated). That interface connects to a small switch, which in turn is connected to a few devices. We can connect handlers, probers, diagnostic equipment, etc and control them through the lan connection. Obviously, we don't want those communicating over the floor network (and that would make it difficult to manage multiple otherwise identical pieces of equipment.
Not sure if this helps you or not. Edited, Aug 12th 2010 5:58pm by gbaji