-1

I am trying to connect my BACNET client which has been containerized and the BACNET server which is running on the host machine. I am using Docker for Windows on Windows 10 (host machine) with Linux containers. I have tried the following:

a. Publishing the ports 47808 for the client container with the run command.

b. Running the container with network=host, to access services of localhost.

c. Tried specifying the gateway IP as the server's IP address with run command.

d. Running the container in the same subnet as my server

e. Running the container with the host IP specified and the ports published. My bacnet server, taken from https://sourceforge.net/projects/bacnet/ always connects to the DockerNAT, 10.0.75.1? Any idea why does this happens? The server application is not a container but an executable file.

Server IP:10.0.75.1 (dockerNAT) Client container running on host machine.

Lakshman Battini
  • 1,842
  • 11
  • 25
  • do you mind re-elaborating what your problem really is? is this a bacnet issue or a docker one. Pretty sure not a lot of people know what `bacnet` really is, so it is best to keep it simple. – Samuel Toh Sep 25 '18 at 05:29
  • @SamuelToh it's more of a docker issue. I have exposed and published the 47808 udp port but can't seem to establish a connection with my BACnet(building automation and control networks) protocol server, which is running on my host machine. – NaveenRai Sep 25 '18 at 05:49
  • I have tried accessing other services (apache, sql) running on the host from within the container and vice versa, i.e. run my container on the host network/publish the ports. Note :(It's a broadcast query that the client executes from within the container to find the server) – NaveenRai Sep 25 '18 at 05:53
  • Have you mapped the container's port to the host? If so you should be able to do something like `localhost:1234` where 1234 is the port number. – Samuel Toh Sep 25 '18 at 05:55
  • I have mapped the port 47808 for the container to the host's. The docker command I run is: docker run -it --network=host --rm -p 47808:47808/udp --name=bacnetclient bacnetclient:14Sept /bin/bash. – NaveenRai Sep 25 '18 at 06:50

1 Answers1

1

From a quick google:

For Windows containers this component is not used and containers and their ports are only accessible via the NATed IP address.

With respect to BACnet, this is going to put you in a world of hurt. You will have to use BACnet BBMD with NAT support in your container to achieve this, and your BACnet Client will have to register as a BACnet Foreign Device. The BACnet Stack at SourceForge does seem to have some NAT support (the code seems to be there but I have never tested it in its original form).

So what you are seeing is 'expected', but your solution is going to require that you become much more familiar with BACnet BBMDs than you ever want to be. Read the BACnet specification carefully. Good luck.

Edward
  • 334
  • 1
  • 3
  • thanks @Edward for your feedback. I am familiar with BBMD and FD, but i believe BBMDs should be used when I am communicating between two IP net/subnet as IP routers don't support broadcasting. Is it because I am trying to communicate b/w docker network-host network and the DockertNAT acts as a bridge b/w these two networks? So, it's fair to say that to my bacnet stack, I am communicating between two different IP networks and thus the need for BBMD? – NaveenRai Sep 26 '18 at 08:22
  • I am not a docker user, so I am only speculating at this point. But as far as BBMDs are required, as soon as you use NAT, you need a NAT-aware(*) BBMD (which inserts the public IP address into the BACnet BVLL header so that the return path is clear to the client.) (*) NAT is an optional service of BBMDs, and most do not support NAT, but as I said, the SourceForge stack does have relevant lines of code.... – Edward Sep 27 '18 at 19:36
  • Is somebody have some news from this subject? I am trying to run my Bacnet application in a docker and I want to discover the bacnet network which is in fact the network of the host. I've tried just about everything, but there is very few information about this problem. – C.Godefroy Jun 24 '23 at 07:33