Subnet mask problem

Nebul0us

Lifetime Supporting Member
Join Date
Dec 2015
Location
Spokane, WA
Posts
125
So for the last few weeks I have been communicating with my PLC's just fine. We use 10.10.10.10 mask 255.255.255.0 on our PLC's. For my laptop I set an IP of 10.10.10.250 mask 255.255.255.0. It has worked fine until today. I was not able to ping my PLC. Finally got IT involved and after a while he was able to get them talking, and what he did was set the mask on my laptop to 255.0.0.0

Can anyone explain to me why this would fix the problem? I also don't understand what could have caused this problem because I haven't changed ANYTHING on my laptops network settings since the last time I went online with a PLC. Can anyone shed some light on this for me? I am having a really hard time wrapping my brain around subnet masking...
 
Do you know the routing setup between your PC and the PLC?
I wonder how many IT switches are in-between? They might use VLANs which have just been 'updated'...
 
Do you know the routing setup between your PC and the PLC?
I wonder how many IT switches are in-between? They might use VLANs which have just been 'updated'...

No devices between. I am hardwired straight from laptop to PLC. I do have a route added however. Because Windows 10 wants to prioritize WiFi adapter over ethernet, I did a command "route -p add 10.10.10.0 mask 255.255.255.0 metric 5 IF 21" as this allowed me to go online with my PLC while being on WiFi at the same time. Before I had to turn my WiFi off first. I don't believe this should affect my subnet issue though. I've never had a problem before using 10.10.10.250 on my laptop with 10.10.10.10 on my PLC both using 255.255.255.0 subnet mask.
 
Last edited:
if someone dare to explain how the mask work, i will be in to learn about it too...

Subnet masking is a Ethernet network Host local/remote identifier when presented to the TCP/IP protocol; it establishes the Host's Local and Network address.

A Subnet mask is a 32-bit number that masks an IP address, and divides the IP address into network address and host address. Subnet Mask is made by setting network bits to all "1"s and setting host bits to all "0"s. It is used mainly for restricting the number of Hosts on any given network segment (subnet).

The most commonly used mask is 255.255.255.0 (11111111 11111111 11111111 00000000) which limits the number of Hosts on the respective subnet to 254.

The OP mask, 255,0,0,0 (11111111 00000000 00000000 00000000) expands the Host limit count to 16,777,216.
 
Subnet masking is a Ethernet network Host local/remote identifier when presented to the TCP/IP protocol; it establishes the Host's Local and Network address.

A Subnet mask is a 32-bit number that masks an IP address, and divides the IP address into network address and host address. Subnet Mask is made by setting network bits to all "1"s and setting host bits to all "0"s. It is used mainly for restricting the number of Hosts on any given network segment (subnet).

The most commonly used mask is 255.255.255.0 (11111111 11111111 11111111 00000000) which limits the number of Hosts on the respective subnet to 254.

The OP mask, 255,0,0,0 (11111111 00000000 00000000 00000000) expands the Host limit count to 16,777,216.

I get that. But none of that explains why changing my laptop subnet mask to 255.0.0.0 would fix my issue. I see no reason why 10.10.10.250 mask 255.255.255.0 can't talk to 10.10.10.10 mask 255.255.255.0
 
No devices between. I am hardwired straight from laptop to PLC. I do have a route added however. Because Windows 10 wants to prioritize WiFi adapter over ethernet, I did a command "route -p add 10.10.10.0 mask 255.255.255.0 metric 5 IF 21" as this allowed me to go online with my PLC while being on WiFi at the same time. Before I had to turn my WiFi off first. I don't believe this should affect my subnet issue though. I've never had a problem before using 10.10.10.250 on my laptop with 10.10.10.10 on my PLC both using 255.255.255.0 subnet mask.



You shouldn't need a router for a direct connection.
When configuring the EtherNet/IP RSLinx driver what choices of Network Adapters you have?
Are you an Administrator on your PC?
 
I want to say that there is no reason that changing the netmask should have fixed the problem.

What was the gateway set to?

Background: What does a netmask do? It determines what is considered a 'local' connection.

The netmask is just like a bitmask in many PLC languages. 255.255.255.0 is the same as 11111111.111111111.11111111.00000000 in binary. So only the last octet is unmasked.

In this case, if anything is sent to an IP address of 10.10.10.xxx is sent from the source to destination. So the computer at 10.10.10.250 should attempt to communicate directly with PLC 10.10.10.10. If you try to connect to another computer lets say, 8.8.8.8, the netmask is used to detect this is on a 'remote' so it forwards the connection to the gateway and the gateway is supposed to route it on to its final destination.

Changing the netmask to 255.0.0.0 means that everything that matches just the first octet is considered local. So, 10.xxx.xxx.xxx should connect directly.

In either case, the netmask should mean the connection is handled locally.

Back to the problem at hand:

The only thing I can think of is that updating the netmask forced an update of the route table. Are you sure that IF 21 is indeed the correct interface? Swapping out external ethernet dongle can cause the interface number to change because windows thinks you are using a different interface (new dongle or different USB port).
 
I did a command "route -p add 10.10.10.0 mask 255.255.255.0 metric 5 IF 21"

I don't think you would have to do this as Windows and most other OSs will add a route for the local subnet of all adapters configured. Where this would be required is if the subnets collided somehow - but I did not see where you listed the WiFi subnet. Is that a 10 network as well? If they are completely separate, something else is going on.

Posting your route table could be helpful - that will determine the interface that will forward the packets, so the answer should lie there. Also that shows if there are multiple default gateways (usually a bad idea) and other such anomalies.

Command: netstat -rn
 
I don't think you would have to do this as Windows and most other OSs will add a route for the local subnet of all adapters configured. Where this would be required is if the subnets collided somehow - but I did not see where you listed the WiFi subnet. Is that a 10 network as well? If they are completely separate, something else is going on.

Posting your route table could be helpful - that will determine the interface that will forward the packets, so the answer should lie there. Also that shows if there are multiple default gateways (usually a bad idea) and other such anomalies.

Command: netstat -rn

Yeah, There is a 10.10.10.x network on the wifi side as well. There should be another thread somewhere where we figured that all out.
 
I get that. But none of that explains why changing my laptop subnet mask to 255.0.0.0 would fix my issue. I see no reason why 10.10.10.250 mask 255.255.255.0 can't talk to 10.10.10.10 mask 255.255.255.0

Subnet masks are easy. It's getting windows to do what you want when there are multiple overlapping interfaces that's hard :p

I have no idea why your usual method didn't work (terminal command), except that maybe some background service was doing something stupid. Did the problem remain after a reboot? Could you get it to work after you disabled your wireless?

It's possible changing the subnet size changed the priority. Or maybe windows liked it because it was the most recent subnet?
 
Yeah, There is a 10.10.10.x network on the wifi side as well.

Having the same subnet on multiple interfaces is difficult to deal with, as you see. I would propose a redesign of the network address space - make them separate subnets and it becomes much easier.

I can attest that Windows does not always configure this properly. It will often create a route but will assign a metric that is below the default routing.

This is not necessarily a misconfiguration; use of the metric for route entry selection is a secondary factor, the primary factor being the most specific route entry will be selected (i.e. most number of 1 bits in the network mask). Only if there are multiple entries will metric be consulted.

For Microsoft:

https://technet.microsoft.com/en-us/library/cc754012(v=ws.10).aspx

Since the subnet mask of a default GW entry is /0 or 0.0.0.0, it would always lose to a more specific local subnet route so metric is not relevant when we have a local interface on that specific subnet.

Now if there are multiple default GWs, or if there are overlapping subnets, etc., all manner of mess can occur. If this has to remain poorly designed, I might try a host specific route for the OP, as in set the route destination to the host IP and use a subnet of /32 or 255.255.255.255 and include the IF parameter to point to the interface directly connected. Metric would not matter, because, the 32 bits in the subnet mask will take priority over the other entries.

Another unlikely to work option in the control space is IPv6. That has the concept of link local IP addresses that are auto-assigned/derived, so directly connected devices in the same broadcast domain are usually found easily through neighbor discovery. But the devices all have to support IPv6, as does the software in use.
 
Yeah, There is a 10.10.10.x network on the wifi side as well. There should be another thread somewhere where we figured that all out.

I don't believe that is the case. Some of us have HP Zbooks and some guys have the tried and true m6800 dell. It's only the newer HP laptops on windows 10 that have the issue of not being able to connect to 10.10.10.x when WiFi is enabled. The windows 7 laptops don't have the issue.
 
I don't believe that is the case. Some of us have HP Zbooks and some guys have the tried and true m6800 dell. It's only the newer HP laptops on windows 10 that have the issue of not being able to connect to 10.10.10.x when WiFi is enabled. The windows 7 laptops don't have the issue.

It probably is Win10 after all; at least it's the last Windows; forever...:D

I have personally acquired a preference when it comes to my laptop's Ethernet connectivity and it served me well for the past fifteen years or so.

Since the on-board NIC was always bound to each site's connectivity settings all the way up to WAN and Domain levels, I have been using a USB-to-Ethernet adapter to connect to automation networks.

The adapter's Network Connection exists only when plugged in and the settings could be quickly matched to the subnet I am trying to connect to; my RSLinx EtherNet/IP drivers carry the "names" of the sites/customers and are all pointing to said adapter.

I could use it from inside VMs as a peripheral disconnected from the Host and it never let me down; it could even connect to DHCP servers in SCADA environments.

My laptop's typical network topology consists of three live and functionally independent connections:
-USB-to-Ethernet patched to an automation subnet;
-on-board NIC patched to the local LAN;
-WiFi connected to a WAN wireless access point.

Every now and then I even Bluetooth my cell phone in; ya know , for 'personal communications'...:D
 

Similar Topics

Hi all, We have to change the subnet mask on ~400 E/IP devices to make the network bigger. Is there a quick way to do that? I can do them one at...
Replies
9
Views
2,746
Hi. Rockwell learning curve 132-1b. I was having trouble to change IP address on a EN2TR. Finally found out that I need to change the IP...
Replies
1
Views
722
I am working with a 1768-ENBT and I was able to connect to it through my laptop. My laptop IP is 192.168.1.10 subnet 255.255.255.0 and the PLC...
Replies
12
Views
1,416
I could not connect to or PLC over or network so I checked and the IP address is correct, but the subnet and gateway are incorrect. It has a...
Replies
2
Views
1,954
Hello guys, How can I change subnet mask on ET200. It is grayed out. I am using TIA 14
Replies
9
Views
2,273
Back
Top Bottom