October 7, 20169 yr Is there a way in UnRAID 6.2 to have a custom MAC address and IP on a Docker container? I know they added some VLAN support and the like but I am not clear on how(if possible) to configure any of this. Thanks!
October 30, 20169 yr Please let me know if you ever find a solution to this. I usually assign custom MAC Addresses (for example I have a Proxmox server with LXC containers) and I manage the NAT rules using my PFSense's DHCP server, so having the ability to assign custom MAC addresses for Docker containers would be fantastic !
October 30, 20169 yr I believe that most people manage to get this to work via the Pipework container
October 30, 20169 yr Author Oh no I am one of those people who find a solution and dont update the thread! The pipeworks container let me get a custom mac and a customer IP. The only issue is it changes the br0 IP address when I start the Docker using the custom IP. I fix this by statically assigning the br0 IP through the terminal.
October 31, 20169 yr Thanks guys, it steers me in the right direction but unfortunately I still can't get it to work. Here's what I did. [*]Went to the Apps page (Community Applications) [*]Searched for pipework [*]Added pipework-1.1.6 container by dreamcat4 (this is for Unraid 6.2) [*]Left default values [*]Went to the Docker tab [*]Made sure Pipework was set to autostart [*]Edited the container I wanted to assign the IP address to [*]Set Network Type to None [*]Switched to Advanced view [*]Added the Extra parameters like this: -e 'pipework_cmd=br0 sickrage dhcpcd 29:57:f5:b6:14:e9' It looks like unRaid is using dhcpcd so that's what I set there because in the doc it says you must use the dhcp program that is installed on the host. The last parameter is the MAC address I want to use. I assign a specific IP address to that MAC from my pfSense (that's what I'm doing for all my machines and it also works fine with my lxc containers on my Proxmox server). As you can see, I'm trying to make this work with the sickrage container. I don't know if the IP address is actually assigned correctly but the problem is accessing the Web UI for sickrage... ? Do you guys have any suggestions on what to try next ? Thanks.
October 31, 20169 yr Author Did you edit the Repository as explained in the support thread for that container? https://lime-technology.com/forum/index.php?topic=43970.0 For unRAID 6.2 you need to use dreamcat4/pipework:1.1.6
October 31, 20169 yr I didn't update the repository. Now I did: Edited the pipework container and set Repository to dreamcat4/pipework:1.1.6. Confirmed that DOCKER_API_VERSION was set to 1.22. Now in the Docker containers list I have By: dreamcat4/pipework:1.1.6 and Version says not available. There is also another container entry at the bottom of the list, in grey that says (orphan image) dreamcat4/pipework:latest. Still not working though. Thanks for the help.
October 31, 20169 yr Author Not sure about the orphan image. Maybe remove both and try again from scratch. Also I used static info instead of DHCP options (see below for my example). -e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.10.12/[email protected] FC:AA:14:91:7D:2E'
October 31, 20169 yr Author Also are you adding the command to the container you want it applied to or the pipework container? It should be in the actual sickrage container in your example. And you dont replace the container name piece with the actual container name.
November 1, 20169 yr First, I tried using the variable @CONTAINER_NAME@ instead of sickrage in the parameter. Then I tried deleting the Orphan image, deleting pipework, re-downloading pipework, and when it asked for the settings I immediately put dreamcat4/pipework:1.1.6 in the repository field. The containers seem to be nicely installed. I tried using a static IP + MAC address like in your example. I tried using dhcp and MAC Address. I'm indeed changing the value of Extra Parameters in the sickrage container. I tried restarting the whole server. I tried stopping docker + VMs and re-saving the Network settings, then restarted everything. Still not working. I will post my actual settings in case there is something wrong with my whole configuration and maybe you'll be able to spot it. Network Settings: MAC address:08:62:66:82:07:04 Enable bonding:Yes Bonding mode:active-backup Bonding members:eth0 Enable bridging:yes Interface description: IP address assignment:automatic IP address:192.168.1.100 Network mask:255.255.255.0 Default gateway:192.168.1.1 DNS server assignment:automatic DNS server:192.168.1.1 Desired MTU: Enable VLANs:Yes I have a pfSense on my network, where I assign static IP Addresses to MAC Addresses and create an ARP entry. I manually assign them in the 192.168.1.100 to 192.168.1.149 range. This works very well for 30+ devices / VMs on my network. In this case, I assigned 192.168.1.119 to MAC address 21:5f:3a:cf:60:96. Pipework container has Privileged ON and Network Type: Host. In the sickrage container, Privileged is OFF (I also tried ON), Network Type is set to None, and in advanced view, in Extra parameters, I use -e 'pipework_cmd=br0 @CONTAINER_NAME@ dhcpcd 21:5F:3A:CF:60:96' I also tried -e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.1.119/[email protected] 21:5F:3A:CF:60:96' If I ping 192.168.1.119, I get this: PING 192.168.1.119 (192.168.1.119) 56(84) bytes of data. From 192.168.1.100 icmp_seq=1 Destination Host Unreachable From 192.168.1.100 icmp_seq=2 Destination Host Unreachable From 192.168.1.100 icmp_seq=3 Destination Host Unreachable From 192.168.1.100 icmp_seq=4 Destination Host Unreachable I don't see anything special in the UnRaid logs. If I simply set Network Type to Host and access http://192.168.1.100:8081/, the sickrage WebUI works perfectly. But using pipework and the extra parameter + network none, I can't access http://192.168.1.119:8081/ (This site can’t be reached). Not sure what is the next troubleshooting step ? Has anybody managed to make this work with sickrage, maybe I should try another container ? Thanks.
November 1, 20169 yr Author What do the sickrage logs say when you start the container up? It should show something about it getting an IP address (see my plex container output below). Joining mDNS multicast group on interface eth1.IPv4 with address 192.168.10.12. New relevant interface eth1.IPv4 for mDNS. Network interface enumeration completed. Registering new address record for 192.168.10.12 on eth1.IPv4. This is the last thing that shows up when initially restarting the container.
November 1, 20169 yr The sickrage container logs [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 10-adduser: executing... ------------------------------------- _ _ _ | |___| (_) ___ | / __| | |/ _ \ | \__ \ | | (_) | |_|___/ |_|\___/ |_| Brought to you by linuxserver.io We gratefully accept donations at: https://www.linuxserver.io/index.php/donations/ ------------------------------------- GID/UID ------------------------------------- User uid: 99 User gid: 100 ------------------------------------- [cont-init.d] 10-adduser: exited 0. [cont-init.d] 30-install: executing... Cloning into '/app/sickrage'... fatal: unable to access 'https://github.com/SickRage/SickRage.git/': Couldn't resolve host 'github.com' [cont-init.d] 30-install: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. and then this line repeats endlessly: python: can't open file '/app/sickrage/SickBeard.py': [Errno 2] No such file or directory In the system logs, I only get this: Nov 1 19:51:50 LimeHive kernel: device veth1pl13417 entered promiscuous mode Nov 1 19:51:50 LimeHive kernel: eth1: renamed from veth1pg13417
November 2, 20169 yr Is this method usefull??? (doesn't use pipework, didn't try it myself, don't know if it works with docker 1.10). http://stackoverflow.com/questions/34688906/how-to-assign-static-public-ip-to-docker-container https://forums.docker.com/t/static-ip-for-containers/2708/4
November 2, 20169 yr Can you try the following. - Try without the mac option to see if that is having an impact. -e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.1.119/[email protected] - What is the pipework log saying? If it is showing errors please post a sample of the log. - Some containers do not play well with network functions. I have tried both pipework and the inbuilt docker networking tools but have found the same results for both. Can you try setting the ip on another container.
November 2, 20169 yr The use of the internal docker networking functions are discussed here https://lime-technology.com/forum/index.php?topic=51335.0
November 3, 20169 yr @tinglis1 I tried without the MAC address option and it gave me the same result. The container's logs are the same as what I posted before. I also tried with another container (PLEX) and it's doing the same thing. Oh wait, I just tried creating a new LXC container in Proxmox and it's not working either, but the previous containers I made with Proxmox are working... So I'm starting to suspect there is something wrong with my network somewhere, starting with IP 192.168.1.119 and up. I have a 10Gbe Netgear switch, maybe there is a setting in there I need to tweak. Unfortunately it requires a Windows machine to install their "ProSAFE Plus Configuration Utility" and I don't have Windows installed on any of my 4 PCs so I'm not able to test right away. I'll try to find a Windows machine and see if I notice anything weird on that switch. I'll keep you posted.
November 5, 20169 yr Alright guys here is the conclusion to this epic quest to assign a static IP to a docker container. There are a few things that need to be configured properly in order for this to work, so a combination of previous steps and the following solved my issue. Note that at this point, even my newly created Promox LXC containers weren't working with addresses from 192.168.1.119 and new MAC Addresses, even if I was following the exact same procedure I was doing before (which was working): I checked my switch configuration (using a Windows VM and installing their ProSafe Management Software) and nothing seemed out of place, actually that switch doesn't have that many settings. Next, I checked my other switch, and decided to reset it because there were lots of configuration options, and I think I remembered tweaking it at some point to make this work for LAN parties. After that, I retried my LXC container created with Proxmox, and it worked ! When I had problems starting my container before resetting my switch, Proxmox was a lot more verbose when it came to tell me it wasn't able to assign the IP address to the container, so that's how I knew something was wrong on my network. On the other hand, the container's logs, the system logs and the docker logs within UnRaid were silent on the issue, and it was just "not working", I hope this can be improved in the future. Before trying the container, I tried with a VM, because with those you can directly assign a MAC address so I thought it would be more straightforward. That's when I faced another issue. Upon saving the VM config, UnRaid complained about the MAC address being invalid (something about being a multicast address). I knew about unicast / multicast addresses but my knowledge on that subject was too limited to understand exactly what role that played in relation to VMs and Containers. So I found out that instead of trying to manually generate a random MAC address, it's much more reliable to generate a MAC address using the "refresh" icon next to the MAC address field of the Edit VM Config page. So I replaced my old MAC Address in PfSense with the newly generated address by UnRaid and used it for that VM, and of course, it worked ! Next step was to test with the container. I first tried using dhcp, but it was still not working, so I then tried using the direct IP/dhcp server + MAC address like so: -e 'pipework_cmd=br0 @CONTAINER_NAME@ 192.168.1.119/[email protected] 36:08:87:2E:73:03' That last setting made it work and I was able to access sickrage's Web UI. Note that the WebUI shortcut still point to the host address so you have to manually change the URL in the address bar to access the IP you manually assigned (again, something I hope can be fixed in the future for our convenience). Now I was not going to just assume it was working, I wanted to confirm the container had actually the right IP assigned. So here is how you can confirm this. You can SSH into your UnRaid box and then run the docker exe command to execute commands inside your docker containers. docker exec sickrage ip -4 address show 22: eth1@if23: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000 inet 192.168.1.119/24 scope global eth1 valid_lft forever preferred_lft forever Last step was to confirm I can setup rules from my PfSense and they would work as expected for that particular IP. So I setup a rule to pass through my VPN and validated with this command: docker exec sickrage curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//' The VPN address showed up. Fantesticles ! Thanks a bunch to all of you for your help, and I hope the information in this thread will also come in handy to other people in case they have similar issues. Have a good day ! Edited August 11, 20187 yr by Ti133700N
Archived
This topic is now archived and is closed to further replies.