How to Detect an Unknown IP address of PLC
12 July 2020.
In this post, we will cover the methods on how to detect and verify the unknown, but correct IP address of a PLC. (Click on the images for a more zoomed view)
Hello programmers. Many a times, we come across situations where we have the PLC with us; but we don’t know it’s IP address. It would be difficult if we don’t have a last backup of the PLC and we then become handicapped as we will not be able to connect to the PLC. Reason; we don’t know it’s IP address and it is an unknown IP address on network.
How to find PLC IP address:
So here, I will show you on how to check PLC IP address when there is an unknown IP address on my network and verify whether it is correct or not. There are many tools available on the internet to solve this issue. But I found these three methods as the simplest to use on how to find IP address of device connected via Ethernet. Why I choose these 3 options, because I have considered three different scenarios and the corresponding option for that. The methods I am discussing here are – Ping Command, Advanced IP Scanner and Wireshark.
Ping command:
Let’s start the first case to check how to ping an unknown IP address. I know the
IP address of the PLC but want to verify it or connect to it. In that case, we
will use the ping command available in our Windows. The
ping command sends packets of data to a specific IP address on a
network, and then lets you know how long it took to transmit that data and get
a response. This method is very useful and fast to test; when you are sure
about the IP address of the PLC and just want to verify it or see whether you can
connect to it or not. Refer the below image. I know the address of the PLC as
192.168.1.190; but once I establish connection with it, then it would be
verified. So, first; see to it whether the IP address of your desktop is in the
same gateway or not. As you see, I have highlighted the steps on how to open internet protocol version 4. Double-click the
1st option and a popup window will open. Click the 2nd option
and a popup window will open. Double-click the 3rd option and a
popup window will open. Now, in this window, verify whether your PC IP address
is in the same gateway range and has a distinguished IP address as compared
with PLC IP address.
First, let me explain gateway range.
If you see the default gateway option, the first three numbers
192,168 and 1 are the numbers which must be compulsorily present in IP address
format (first three numbers). This shows that the device (here PLC) with an IP
address is in the same range as the PC. The fourth digit in the IP
address option determines the ID of the device, which is in the range
1-255. That means, to establish a network, all the devices (whether PC or PLC
or any other Ethernet device) must be in the same gateway range to communicate.
Now, you would be wondering how a large network with hundreds of devices and
computers in an office establishment would fulfill this, if the ID is limited
to 255. Well, with the help of DNS server address and other advanced settings;
it is possible to expand the network. However, I won’t go deep into it and
rather focus on our study. It eventually concludes that even if you are checking
the PLC in some larger environment, then too this basic theory of gateway range
is applicable. So, here, my PC IP address is 192.168.1.50 and
the PLC IP address is 192.168.1.190.
Now, let’s see how the ping command
works. Refer the image below. It runs on windows command prompt. In
Windows, press Windows + R. In the Run window, type “cmd” into the
search box, and then press Enter. The command prompt window will open as below.
Type ping 192.168.1.190 and press enter. If the
PLC responds, then the output will be shown as in first part; otherwise, it
will show as second part. If the PLC is not responding, then there might be
these issues – either the cable connection is loose or wrong, or the Ethernet
port from either side is not working, or the IP address entered is wrong or the
network settings in the PLC/PC is wrong.
So, we conclude that this method requires pre-knowledge of the IP address you are scanning or verifying. But, if you don’t know the IP address, then let’s move ahead for the second method.
Advanced IP scanner:
This is third-party
software which is an open source and is used to detect a network of IP
addresses within the gateway range. The limitation that we faced in the first
case is removed here. If you know that the IP address of the PLC is within the
gateway range that, you are sure; then this software can be handy for use.
Refer the video
below. In this part, I have kept the PLC IP address as 192.168.1.190 and
the PC IP address as 192.168.1.50. As per our
earlier reference, both the devices are in the same gateway range of 192.168.1.X. So,
this software will scan all the IP addresses present in this range and show you
the IP address of PLC (M241 used here) with it’s MAC ID for confirmation.
Now, I will change my
desktop IP address to 192.168.0.50 and due to this, the
software will not scan the PLC. Refer the video below.
How to Set Advanced IP Scanner
This concludes that this tool is useful if you know the gateway range of the PLC; otherwise, it can’t detect a device outside your desktop gateway range. So, let’s move ahead for the third method.
Wireshark:
This is another third-party software
which is an open source and is used to detect a network of IP addresses in any
gateway range. It detects various internet protocols in a single scan. This
software is handy to use if you are blank on what will be the IP address of PLC
and you even don’t know it’s gateway range.
I will explain this in only one video, on how to find unknown IP address using Wireshark, where I will keep my desktop gateway address different with PLC gateway
address. Refer it below. In this part, I have kept the PLC IP
address as 192.168.1.190 and the PC IP
address as 192.168.0.50. As per our earlier reference, both the
devices are in the different gateway range. So, this software will
scan all the IP addresses and other protocols irrespective of the range and
show you the IP address of PLC (M241 used here). You will then have to verify
it by the MAC ID of PLC; because this is the only data which you have.
Guys, I observed that once we use
Wireshark and close it, our desktop Ethernet port gets blocked sometimes.
Means, we would not be able to ping any device from our desktop. This is rare
and happens only sometimes. But, not to worry; just open the software again and
start scanning again. It will reopen your port.
I have covered the general principles which normally are followed to detect and verify an unknown IP address. I have also not attempted to cover every type of software and methods; you can find other ways on the internet. But these three methods are widely used. You can use it for any type of Ethernet IP device, not just PLC.
Thank you,
guys; I hope you enjoyed reading the practices normally used for this type of
study in industrial automation.
What Is My IP Address, Visit Our Website for ipv4 and ipv6 ip address WhatIsMyIPAnAddress.com
ReplyDeleteMy IP Address, Findout Your IP Address, My ipv4 IP Address, My ipv6 IP Address
What is My Ip Address
What Is My IP Address, Visit Our Website for ipv4 and ipv6 ip address WhatIsMyIPAnAddress.com
ReplyDeleteMy IP Address, Findout Your IP Address, My ipv4 IP Address, My ipv6 IP Address
What is My Ip Address
This is an awesome post which gives almost perfect idea about web application scanners.
ReplyDeleteIP Scanners