• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Container IP address - Network Options
#1
Hello all, looking for a little advice, all I want is a RaspberryPi (with Codesys) container that I can set (and change afterwards) its IP address. What network option do I need when creating the container (Bridge, host, Container).
  Reply
#2
Hello Kim, you are right that there are network options like "bridge" and "host" you can generally select when you start a container.

But those options do not have an immediate effect on the ip network address that is used by a container on a Docker host like netPI. They have only an effect if A.) a container shares the ip network stack of the Docker Host in case you select "host" (and hence get's the same ip network address as the host) or if B.) each container is started with a separate ip network stack and get an internal local ip address within the host system. But looking from "outside" to netPI - in detail I mean to the upper single RJ45 ethernet port - the ip address that is effective is the one you set up in netPI's main Web GUI under the menu item "network\LAN". This ip network address can be either DHCP based or static, but you cannot change it in a container dynamically. Once set it is fixed.

But Kim as you have maybe recognized netPI also has two additinal RJ45 network ports, which are made for industrial ethernet networks ... but these two can be configured also to support normal TCP/IP communication. And the best of it is, that for these two network ports you can set up ip addresses dynamically in the container. How you do that is explained in the Docker example container we made public here. Since all Hilscher Docker containers are available in source code also, you can have a look here how the container does it and how to set up the industrial network controller to become a standard ethernet network controller.

So Kim your work will be now to combine the Codesys example container and the Ethernet-network example container into one container and load it to your netPI. Then still the single ethernet port is unconfigureable in a container ... but the two additional network ports get configureable dynamically as explained in the readme text of the network example container.


You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
Armin, Thanks for the advice. I will give it a go.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  TOSILOCK for CONTAINER COswald 3 2,183 July-13th-2021, 11:32 AM
Last Post: Armin@netPI
  Remot VPN connection from netPI to company network JG_KIT 6 2,906 July-8th-2021, 02:55 PM
Last Post: JG_KIT
  Access to RTC from my own container application tad 1 3,520 March-19th-2021, 02:58 PM
Last Post: Armin@netPI
  [SOLVED] Starting services/commands/scripts at startup of a container Jonas.Sellmann@outlook.de 9 6,014 March-9th-2021, 08:47 AM
Last Post: WalterSchaefer
  OpenVPN container Armin@netPI 0 1,612 January-3rd-2021, 12:13 PM
Last Post: Armin@netPI
  operating Console of a container on netPI connected to Wi-Fi tethering tad 3 2,611 December-3rd-2020, 12:32 PM
Last Post: tad
  NIOT-E-NPIX-4DI4DO with netpi-netx container WalterSchaefer 3 6,475 November-25th-2020, 01:06 PM
Last Post: zen89
  NPIX-4DI4DO and NetPi-Nodered container issues alhammi 4 7,583 November-16th-2020, 01:35 PM
Last Post: alhammi
  Get host MAC via REST API inside container bschandra 4 3,640 November-16th-2020, 09:26 AM
Last Post: bschandra
  Network issues after upgrading to Stretch + kernel to 5.4 carmel85 2 3,013 July-28th-2020, 03:04 PM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)