In the network media video one from the network plus module. You said you were showing Wes a networking IP to MAC binding trick to work with an IP camera. What's the trick? Thanks.
What was the trick?
We had an IP camera that shipped with no default IP address. Instead, you were supposed to connect to it with a proprietary cable so that you could assign it an IP. Unfortunately, we didn't seem to have the cable anymore. So, I did a little trick that can get around that problem with devices like these. While PCs use IP addresses to find machines, at the end of the day they use the Layer 2 MAC Addresses to actually communicate. So, the trick was to spoof an IP/MAC mapping to allow me to talk to the camera that had no IP. The basic steps are this:
- Get the MAC address for the device without an IP. It is usually written on a sticker on the device.
- Connect a crossover cable between your PC and the device in question.
- Assign an IP on your PC (e.g. 192.168.0.1)
- Modify your ARP table to map another IP to the MAC of the device. You will do something like this:
arp -s 192.168.0.2 00-aa-00-62-c6-09
- Finally, ping 192.168.0.2.
In step 5, your PC will skip the ARP discovery process because it already knows the MAC address of that IP. You will then send your data to that Layer 2 address. The camera will learn your MAC address through the initial connection and you should be able to communicate with the device using the spoofed 192.168.0.2 address.
This doesn't always work. For example, any encrypted communication would break because you can't establish stateful communications with mismatched addresses like this, but basic communications like telnet and HTTP will work fine.
Like I said, definitely not something you should normally have to do, but it does work.
Very interesting I knew about mapping static ARP entries but that is an actual use for it :-)
Oddly enough on my Win 8.1 laptop it didn't work. May have been the camera since it already had a different IP on my network as well so I'm not sure what caused me to not connect.
The real weird issue to me though is when I ran arp -d to delete it if you ran verbose arp -av it showed it didn't actually delete it but rather filled the MAC with all 0's and kept it in the table so I ended up getting odd errors and just gave up.