Re: TCP connection to MAC address



Nicolas Noakes wrote:
> Chris,
>
> The device a networked logic controller. There is no practical method
> available for displaying or otherwise retrieving it's current IP
> address. It does not support DHCP - I assume for the same reason that it
> cannot tell you what it is using so it would be pointless. The device
> may not have an address set (as supplied), or may be on another IP
> subnet, or you may just not know its IP address.
>
> Therefore, until you have set the device to an explicit IP address that
> you know of, you have no way of communicating with it on the network.

Understood. I'm surprised that they don't support the loopback interface.

[Snippage of instructions]
> This process in not difficult or problematic, but it is very manual. I
> would like to write a small utility where I can simply enter the MAC
> address and desired IP address and click "Set". Both as a useful tool,
> and to learn networking from a C# point of view.
>
> Does that help? Thanks for your interest.

Yes it does. Going back to your OP:

> Basically it looks like creating a TCP connection on port 1, based on
> MAC address instead of IP address, then a normal TCP connection on
> port 80 to do an HTTP POST and set the IP address. The first step may
> be a little more involved, since the IP address will have to be
> included somewhere.

It is not initiating a TCP connection to a MAC address, as those are on different layers. All it is doing is emulating the loopback address by setting a default IP, and hitting it on a specific port as a sort of "secret knock" to unlocking the web interface to the configuration manager.

All you need to really do is:
- Set the static arp table entry to the IP you've chosen.
- Open a TCP connection to that IP on port 1.
- When that fails (you indicated it wasn't expected to work), ignore the failure and connect to port 80 using a web browser control.

In your code the only thing involving the MAC would be setting the ARP table entry, and possibly retrieving the MAC address. It is still a very separate step from the TCP connection to TCP/1 and initiating a web browser connection.

My suggestion would be to use localhost as the default address (127.0.0.1) provided it is not already in use on the device. If not, pick an unused private IP range (10/8, 192.168/16, or 172/8 - IIRC) and assign it an IP in those ranges.

Chris.
.



Relevant Pages

  • RE: How to find a changing IP on ethernet network
    ... called "port security". ... tell it how many MAC ... to issue an SMTP trap to your Network Management ...
    (Security-Basics)
  • Re: Networking over mains cables
    ... blocking just about every port except the basic ones needed to ... without blocking him completely it was useable. ... When entering a network key, ... allow the MAC addresses of the machines I know about. ...
    (comp.sys.acorn.networking)
  • Re: How Do I Keep Private Computers Off of Our Network?
    ... I recommend enabling port security on on all the switches; ... port to the system's MAC address and then disabling the unused ports. ... If you really need to lock it down then Network Access Control through ... are using their business computer's wired connection to connect ...
    (microsoft.public.windows.server.active_directory)
  • Re: Scan for "outsider" Pcs on network
    ... can use is the MAC address. ... switch ports by MAC address does not secure one's Ethernet network. ... switch port set up to only accept their mac address. ... OpenBSD Box (SOB) set up as a bridge.He drops it inline with the ...
    (Focus-IDS)
  • Re: Not able to print to shared OS X printer
    ... I've been printing to that exact Brother ... > It's shared, via a Mac running OS X, over the network. ... My guess - and I have no way of testing this, is that Mac users don't ... transmit on cups port but transmit on afp over tcp port and thus ...
    (Fedora)