• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Container IP address - Network Options
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).
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)

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

Possibly Related Threads...
Thread Author Replies Views Last Post
  netpi-desktop-hdmi with setting network=bridge tad 13 54 June-19th-2020, 12:50 PM
Last Post: tad
  VPN tunnel to netPI and local network in 10 minutes Armin@netPI 0 49 June-5th-2020, 05:40 PM
Last Post: Armin@netPI
  Exporting and importing container images Armin@netPI 3 46 May-20th-2020, 11:24 AM
Last Post: COswald
Exclamation Creating a container Linnerz 6 40 March-6th-2020, 02:47 PM
Last Post: Armin@netPI
  [SOLVED] activate LED1/2 with Node-RED + fieldbus nodes container Christian_Rau 6 97 October-21st-2019, 10:30 AM
Last Post: Armin@netPI
  Cannot start container Magnus 7 43 October-16th-2019, 01:00 PM
Last Post: Armin@netPI
  Generate VLAN interfaces in container FrankJacob 7 46 September-26th-2019, 03:19 PM
Last Post: Armin@netPI
  create container in Portainer v1.12.4 dcatteeu 2 26 September-9th-2019, 12:12 PM
Last Post: dcatteeu
  UMTS/LTE support via USB router/modem sticks in a container Armin@netPI 3 159 September-5th-2019, 02:07 PM
Last Post: Armin@netPI
  Ready-to-deploy: full featured Node-RED container Armin@netPI 5 89 July-25th-2019, 06:16 AM
Last Post: Armin@netPI

Forum Jump:

Users browsing this thread: 1 Guest(s)