IP change on container


jofri

Recommended Posts

Hi, 

 

Spent lots of time to clear this out but now I need someone who got some more expertizeee :)

Im running a unraid 6.3.5 on a HP microserver. gen8

 

I need to change ip adresses on one of my container. ( domoticz ) the ports is in confict. 

 

I haved followed some guideline on google, pipework and this. 

 

None of them is working for me, and im i noobie in Linus.

 

I have created a network: 

 

root@Teknikum:~# docker network inspect homenet
[
    {
        "Name": "homenet",
        "Id": "b5c44e9dfc6776cc452a82d9bd1f882f06e6fb62c442572cb6bd10cba9609340",
        "Scope": "local",
        "Driver": "macvlan",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "192.168.1.0/24",
                    "IPRange": "192.168.1.128/25",
                    "Gateway": "192.168.1.1"
                }
            ]
        },
        "Internal": false,
        "Containers": {},
        "Options": {
            "parent": "eth0"
        },
        "Labels": {}
    }
]
root@Teknikum:~# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
68f3ccdc9a55        bridge              bridge              local
b5c44e9dfc67        homenet             macvlan             local
2e2532ffa672        host                host                local
cec9fbee9d1b        none                null                local
root@Teknikum:~#
This is my network settings.

 

image.thumb.png.19a9fe785f975cc2926d275433f974e4.png

 

I have 1 ethernet cabel connected to the microserver. 

 

This is my router.

 

image.thumb.png.45cbaa6f4dea1e7a4213ef039d426ec1.png

 

This is my config after failing installation.

 

image.thumb.png.a5789923c03f279ba7e9721315d1e80b.png

 

I have also tried this extra parameter: --cap-add=NET_ADMIN -e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.1.91/[email protected] xx:xx:xx:xx:xx:xx'

Not working,

Does anyone have some tips or something I need to check?

Please let my know if you need some more info :)

 

 

Big thanks in advance!

 

 

 

Link to comment
2 hours ago, jofri said:

When i will run https: it will ports conflicts with other containers.

 

 

Not if you change the port. Change it to something else than 1443 and you are good to go. 

This is the reason you have a host and container port. You keep the container port as is and can change the host port, the one easily edited in the template, to a port not used in another container. 

Edited by saarg
Link to comment

[services.d] done.
2017-11-13 19:36:15.609 Domoticz V3.8720 (c)2012-2017 GizMoCuz
2017-11-13 19:36:15.609 Build Hash: 2fc1ac2e, Date: 2017-11-10 15:07:42
2017-11-13 19:36:15.609 Startup Path: /var/lib/domoticz/
domoticz: Domoticz is starting up....
domoticz: Domoticz running...
domoticz: PluginSystem: Started, Python version '3.6.1'.
2017-11-13 19:36:15.642 PluginSystem: Started, Python version '3.6.1'.
domoticz: Active notification Subsystems: gcm, http (2/14)
2017-11-13 19:36:15.645 Active notification Subsystems: gcm, http (2/14)
domoticz: WebServer(HTTP) started on address: 0.0.0.0 with port 8080
2017-11-13 19:36:15.664 WebServer(HTTP) started on address: 0.0.0.0 with port 8080
domoticz: WebServer(SSL) started on address: 0.0.0.0 with port 1443
2017-11-13 19:36:15.670 WebServer(SSL) started on address: 0.0.0.0 with port 1443
2017-11-13 19:36:15.670 Proxymanager started.
domoticz: Proxymanager started.
domoticz: Starting shared server on: 0.0.0.0:6144
2017-11-13 19:36:15.673 Starting shared server on: 0.0.0.0:6144
2017-11-13 19:36:15.673 TCPServer: shared server started...
domoticz: TCPServer: shared server started...
domoticz: RxQueue: queue worker started...
2017-11-13 19:36:15.673 RxQueue: queue worker started...
domoticz: EventSystem: reset all events...
2017-11-13 19:36:17.675 EventSystem: reset all events...
domoticz: EventSystem: reset all device statuses...
2017-11-13 19:36:17.675 EventSystem: reset all device statuses...
2017-11-13 19:36:17.695 Python EventSystem: Initalizing event module.
2017-11-13 19:36:17.695 EventSystem: Started
2017-11-13 19:36:17.695 EventSystem: Queue thread started...
domoticz: Python EventSystem: Initalizing event module.
domoticz: EventSystem: Started
domoticz: EventSystem: Queue thread started...
domoticz: EventSystem: reset all events...
2017-11-13 19:36:17.675 EventSystem: reset all events...
domoticz: EventSystem: reset all device statuses...
2017-11-13 19:36:17.675 EventSystem: reset all device statuses...
2017-11-13 19:36:17.695 Python EventSystem: Initalizing event module.
2017-11-13 19:36:17.695 EventSystem: Started
2017-11-13 19:36:17.695 EventSystem: Queue thread started...
domoticz: Python EventSystem: Initalizing event module.
domoticz: EventSystem: Started
domoticz: EventSystem: Queue thread started...
2017-11-13 19:36:18.121 PluginSystem: Entering work loop.
domoticz: PluginSystem: Entering work loop.

Link to comment

Your mixing pipework with the alternate manual macvlan method.  If you stay with pipework (undo all the manual macvlan first and enable br0 bridge) you can either change the IP address in the 'extra options' box in the Docker config (advanced view turned on) or change the port map to use a different port.  Ideally each Docker should have a unique IP when used with pipework as that is what it was written for.  Pipework or manual macvlan - one method or the other, but use only one method.

Edited by unevent
Link to comment

HI, I feels that Im going for the pipworks solution.

 

Okay, How do I enable br0 bridge?

Should I remove the network called Homenet also. 

 

 Whats the commands in the Extra options box ( parameter) for setting a new Ip adress for a container?

 

Big thanks in advance!

 

 

Link to comment
5 hours ago, jofri said:

HI, I feels that Im going for the pipworks solution.

 

Okay, How do I enable br0 bridge?

Should I remove the network called Homenet also. 

 

 Whats the commands in the Extra options box ( parameter) for setting a new Ip adress for a container?

 

Big thanks in advance!

 

Do you have the pipework Docker installed?  The br0 bridge can be enabled in the Network Settings page in the GUI - set the 'Enable Bridging' to Yes and set the 'Bridging Members' to the interface you intend to use (eth0 as example).  The 'Homenet' thing sounds like part of the manual macvlan method, and if going with pipework, yes remove it.  Install the pipework Docker if not already.  Start it and view the log for it and check the last line of the log has 'started' in it.  Sometimes it will not start and so you stop then start again until the last line shows pipework start.  Pipework should be the running before starting any other Dockers that use it.  PIpework itself requires no configuration.

 

For each Docker you want to assign an IP for, view the Docker config page and change "Network Type' to 'None'.  In the 'Extra Parameters' box, add the line below, but change the IP addresses for those you are using on your network.  It is set up as [IP of Docker]/24@[gateway address].  The '@CONTAINER_NAME@' needs to be exactly that, do not change it to match the Docker name.  In the example below, the IP of the Docker will be '192.168.1.110' with a Gateway of '192.168.1.1'.

-e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.1.110/[email protected]'

The IP address you choose for each docker should be outside the range for DHCP if you have one configured on your network.

 

There are more ways to use pipework such as associating the IP to a MAC address so you can do a static map on your router and associate the IP with a hostname in local DNS so instead of typing '192.168.1.110:[port]' into a web browser, you can do 'http://sabnzbd:[port]', as example.  If you change the Docker host port to container port map to 80 or 443 for http/https, respectively, you can get rid of the port requirement and just do https://sabnzbd, http://plex, etc.  So plex host map would be 80 while the container map would be 32400, as example.  There is a trickle-down effect with this port map method depending on the Docker for connectivity requirements with the outside world and may not work for every Docker.

-e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.1.110/[email protected] fd:df:b6:95:53:1c'

The MAC address should be unique, random, and valid for each IP.  The remainder is up to whatever router you use on your network to assign the MAC/IP static map to hostname.

Link to comment

Just my 2 bits: pipework was the docker ip solution before the macvlan system was developed.

With docker macvlan solution, pipework is technically deprecated (and is a rather convoluted solution mind you)

That said, the macvlan solution has a security feature that is a bit annoying if you only have one NIC on your unRAID machine and no VLAN capable switch/router, as it will prevent your containers from talking to unRAID

Link to comment
42 minutes ago, ken-ji said:

Just my 2 bits: pipework was the docker ip solution before the macvlan system was developed.

With docker macvlan solution, pipework is technically deprecated (and is a rather convoluted solution mind you)

That said, the macvlan solution has a security feature that is a bit annoying if you only have one NIC on your unRAID machine and no VLAN capable switch/router, as it will prevent your containers from talking to unRAID

 

Pipework EOL should be 6.3.5 as it was written to perform this function before Docker had a native method, and I don't see it as a convoluted solution as it is simple to implement and customize.  Moving forward with 6.4 release there are native Docker methods to use that hopefully get better and easier with age.

Link to comment

Hi again,

I have now removed the docker network homenet

I have allready installed pipework and its has been started accouring to the logs.

 

I guess that the dockername should be "domoticz" or nothing else?

I set the network - set the 'Enable Bridging' to Yes and set the 'Bridging Members' to the interface you intend to use eth0.

 

The strang this is that when i type in a ip adress like 192.168.1.93 for example. see picture.

 When I start up the domoticz its open my other app unifi controller on ip adress: https://192.168.1.192:8443

 

Could it be something with the Host port and contaioner port?

Whats the different?

 

/ johan

 

 

Capture.JPG

Link to comment

Just checing the logs for pipworks:

 

Device "eth1" does not exist.
event_line=2017-11-15T19:42:49.791578810+01:00 container die e6db63e4c793ff44b1fb814974e47367092b702dba123a7193c97bf4c7c6c102 (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52w39-UTC, exitCode=0, image=linuxserver/domoticz, name=domoticz)

 

why its picking up eth0 then i have named it to eth0 in the network settings.

 

 

Link to comment
6 minutes ago, jofri said:

Hi again,

I guess that the dockername should be "domoticz" or nothing else?

I set the network - set the 'Enable Bridging' to Yes and set the 'Bridging Members' to the interface you intend to use eth0.

 

The '@CONTAINER_NAME@' needs to be exactly that, do not change it to match the Docker name:

-e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.1.193/[email protected]'

 

6 minutes ago, jofri said:

The strang this is that when i type in a ip adress like 192.168.1.93 for example. see picture.

 When I start up the domoticz its open my other app unifi controller on ip adress: https://192.168.1.192:8443

 

Could it be something with the Host port and contaioner port?

Whats the different?

 

/ johan

 

After you correct the container_name variable above, you would then use the port you have configured in the Docker config.  I don't see '8443' in the pic you posted.

Link to comment
3 minutes ago, jofri said:

Just checing the logs for pipworks:

Device "eth1" does not exist.
event_line=2017-11-15T19:42:49.791578810+01:00 container die e6db63e4c793ff44b1fb814974e47367092b702dba123a7193c97bf4c7c6c102 (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52w39-UTC, exitCode=0, image=linuxserver/domoticz, name=domoticz)

 

Something is configured for eth1 or bridge br0 has eth1 included.

Link to comment

Logs for pipworks keeping saying:

 

Device "eth1" does not exist.
event_line=2017-11-15T20:08:58.618946004+01:00 container start a279f8091eb1da176d490e67adfd502b05bd680ea09c542c7acfa82d7da3ab5e (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52:39-UTC, image=linuxserver/domoticz, name=domoticz)
Device "eth1" does not exist.
event_line=2017-11-15T20:09:56.573557841+01:00 container die a279f8091eb1da176d490e67adfd502b05bd680ea09c542c7acfa82d7da3ab5e (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52:39-UTC, exitCode=0, image=linuxserver/domoticz, name=domoticz)
event_line=2017-11-15T20:09:57.287172915+01:00 container start 45a527fe69fe6708fa739558d1a1011adfde902381aa5c40e4f856c73725d257 (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52:39-UTC, image=linuxserver/domoticz, name=domoticz)
event_line=2017-11-15T20:13:53.618663394+01:00 container start 79d0195f1f0273356437c46fa5dd2627c2df290a82161104c03f2e0c7e09a747 (image=dreamcat4/pipework, name=pipework-1.1.6)
event_line=2017-11-15T20:13:53.969464043+01:00 container start fda4b30fa2b1d9713de4526fdb437c7f172dec9ac8bfbd5e14f3778db8103705 (image=mace/ddclient, name=DDclient)
event_line=2017-11-15T20:13:54.309723499+01:00 container start ef4d2d6468620f65850786c97152a44f0d3e7d4c208abe288a63ff4c1f4d0546 (image=limetech/plex, name=PlexMediaServer)
event_line=2017-11-15T20:13:54.640568879+01:00 container start d5ed16b92c6a8a69c5dafe127465ed59c28baeb19267ef77ff289db39a375964 (image=pducharme/unifi, name=UniFi)
event_line=2017-11-15T20:13:55.251236510+01:00 container start a05dd46e3449304a018e8f8a63fe1b411aa8c750720aea0eb7fc07a8ef6b410d (image=pducharme/unifi-video-controller, name=UniFi-Video)
event_line=2017-11-15T20:15:25.874054663+01:00 container start ae55574896fc626e8dccf739521125645a754e037c82d906f0e197652206d15e (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52:39-UTC, image=linuxserver/domoticz, name=domoticz)
Device "eth1" does not exist.
Device "eth1" does not exist.

Link to comment
45 minutes ago, jofri said:

But should i type br0 or eth0 ?

Im bit confused here.

 

Please check the picture of my network settings.

then i type: -e 'pipework_cmd=eth0 @CONTAINER_NAME@ 192.168.1.193/[email protected]'

 

its open my container https://192.168.1.192:8443/

 

i dont see any settings the eth1 or br0 ?

 

First pic you show eth0 with a bridge only including eth0, which is correct.  Show a pic of the eth1 configuration.  Your unRAID server is on x.x.x.192, you have the Domoticz Docker on x.x.x.193 - looks fine.  Set to br0, not eth0:

-e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.1.193/[email protected]'

 

The Docker hub page for this Docker shows three port maps, a 1443, 6144, and 8080.  Edit: According to the instructions 8080 is the port you use to access the application web interface.

Edited by unevent
Link to comment
24 minutes ago, jofri said:

Logs for pipworks keeping saying:

 

Device "eth1" does not exist.
event_line=2017-11-15T20:08:58.618946004+01:00 container start a279f8091eb1da176d490e67adfd502b05bd680ea09c542c7acfa82d7da3ab5e (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52:39-UTC, image=linuxserver/domoticz, name=domoticz)
Device "eth1" does not exist.
event_line=2017-11-15T20:09:56.573557841+01:00 container die a279f8091eb1da176d490e67adfd502b05bd680ea09c542c7acfa82d7da3ab5e (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52:39-UTC, exitCode=0, image=linuxserver/domoticz, name=domoticz)
event_line=2017-11-15T20:09:57.287172915+01:00 container start 45a527fe69fe6708fa739558d1a1011adfde902381aa5c40e4f856c73725d257 (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52:39-UTC, image=linuxserver/domoticz, name=domoticz)
event_line=2017-11-15T20:13:53.618663394+01:00 container start 79d0195f1f0273356437c46fa5dd2627c2df290a82161104c03f2e0c7e09a747 (image=dreamcat4/pipework, name=pipework-1.1.6)
event_line=2017-11-15T20:13:53.969464043+01:00 container start fda4b30fa2b1d9713de4526fdb437c7f172dec9ac8bfbd5e14f3778db8103705 (image=mace/ddclient, name=DDclient)
event_line=2017-11-15T20:13:54.309723499+01:00 container start ef4d2d6468620f65850786c97152a44f0d3e7d4c208abe288a63ff4c1f4d0546 (image=limetech/plex, name=PlexMediaServer)
event_line=2017-11-15T20:13:54.640568879+01:00 container start d5ed16b92c6a8a69c5dafe127465ed59c28baeb19267ef77ff289db39a375964 (image=pducharme/unifi, name=UniFi)
event_line=2017-11-15T20:13:55.251236510+01:00 container start a05dd46e3449304a018e8f8a63fe1b411aa8c750720aea0eb7fc07a8ef6b410d (image=pducharme/unifi-video-controller, name=UniFi-Video)
event_line=2017-11-15T20:15:25.874054663+01:00 container start ae55574896fc626e8dccf739521125645a754e037c82d906f0e197652206d15e (build_version=Linuxserver.io version:- 71 Build-date:- November-10-2017-23:52:39-UTC, image=linuxserver/domoticz, name=domoticz)
Device "eth1" does not exist.
Device "eth1" does not exist.

 

Your Plex, Unifi, and DDclient containers, can you post a pic of those config pages?  Looks like they are running, but want to be sure you have unique IP addresses for those.  If they do, this looks like a Docker config issue or remnants of the manual macvlan still on your system.

Link to comment

All my other containers running on the same ip adress with different ports.

I just want to change the ip adress for the Domoticz

I have no pipeworks settings for the other containers.

They are up and running as well.

 

Dont understand way this is so hard to set a static ip adress on a container.

Is there some way to set an ip adress via the console SLI ?

 

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.