January 28, 20188 yr 10 minutes ago, theiam79 said: @bonienl Was wondering if I could get some help with this. Server has a quad NIC, and I'd like to take one of those and use it for one specific container, leaving the rest as they are (at least for now). I set the eth1 interface up with a static IP, and I'm able to choose that interface in the container template. When I start the container I am able to ping it locally just fine, but it cannot reach the internet. I've been all over the forums looking for an answer, and I'm sure its just me missing something, but any help would be appreciated. Make sure you have included a gateway address in the static assignment of eth1.
January 28, 20188 yr 20 minutes ago, bonienl said: Make sure you have included a gateway address in the static assignment of eth1. Yeah I've got that in there. I've attached an image of my eth1 config as well as the container network settings A sidenote, not sure if this is expected but if you change or remove a network config that a container uses (such as changing eth1 to be a bridge), even if it does not auto start, you can no longer make changes to it or use that template due to a missing csrf token error and have to manually recreate it
January 28, 20188 yr Can you check the network settings of a container. For example docker inspect Nginx ... ... "NetworkSettings": { "Bridge": "", "SandboxID": "a3228a9b01a477997147b210b7abb698388002a2b02c0060f1a59c6f076dfd63", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": {}, "SandboxKey": "/var/run/docker/netns/a3228a9b01a4", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "br0.5": { "IPAMConfig": { "IPv4Address": "10.0.105.80" }, "Links": null, "Aliases": [ "b0a2f036efa2" ], "NetworkID": "5836f741b6a21bbf9d39d2741c255981c6f3a74764d181f67a55f0df0022283c", "EndpointID": "ba22018d5be273b5d6b1edbf7f00ed33b5e12eabbcd8a41834b95c64cf04c831", "Gateway": "10.0.105.1", "IPAddress": "10.0.105.80", "IPPrefixLen": 24, "IPv6Gateway": "2a02:a448:32d5:105::1", "GlobalIPv6Address": "2a02:a448:32d5:105::5", "GlobalIPv6PrefixLen": 64, "MacAddress": "02:42:0a:00:69:50", "DriverOpts": null } } } Is it possible to ping an address from within the container. For example. docker exec -it Nginx bash root@b0a2f036efa2:/$ ping www.google.com PING www.google.com (172.217.20.68): 56 data bytes 64 bytes from 172.217.20.68: seq=0 ttl=56 time=9.806 ms 64 bytes from 172.217.20.68: seq=1 ttl=56 time=6.645 ms 64 bytes from 172.217.20.68: seq=2 ttl=56 time=6.126 ms 64 bytes from 172.217.20.68: seq=3 ttl=56 time=8.906 ms
January 28, 20188 yr On mobile ATM so I can try to get you the inspect output if you need. I am unable to ping out from the container, even local addresses appear to do nothing.
January 28, 20188 yr "NetworkSettings": { "Bridge": "", "SandboxID": "94842cd874bb3ddb54dcd527436d33f716628af320e08ef8b194dd35f752f829", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": {}, "SandboxKey": "/var/run/docker/netns/94842cd874bb", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "eth1": { "IPAMConfig": { "IPv4Address": "192.168.1.122" }, "Links": null, "Aliases": [ "189987dcde57" ], "NetworkID": "30e822af550842c5c44ee66f4ff5189256a0adfc65f3cde8234539319bbfd4f0", "EndpointID": "888872d1dfb62147f519d9efc882802792ac86c7182a7126a9ef982f9886b3fe", "Gateway": "192.168.1.2", "IPAddress": "192.168.1.122", "IPPrefixLen": 24, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "02:42:c0:a8:01:7a", "DriverOpts": null } } } } ] @bonienl
January 28, 20188 yr The gateway address (192.168.1.2) is wrong. It should be 192.168.1.1 (assuming the setting for eth1 is correct). Try the following. This resets the docker networking. rm /var/lib/docker/network/files/local-kv.db /etc/rc.d/rc.docker restart
January 28, 20188 yr Ok, I just found out that Docker does not allow the same gateway address on two different interfaces. See also this discussion.
January 28, 20188 yr Ah, that makes sense, I'll take a look tonight or tomorrow and report back, thanks for the help!
January 29, 20188 yr Alright, so I set up an IP alias for my lan in pfsense, and set eth1 to use that. After deleting and restarting docker the container still used 192.168.1.2 as the gateway. I tried manually deleting and creating the network with the new gateway, and got an error about it already being in use. I then created a second alias on pfsense and made a custom network specifying that as the gateway, and then choosing that and manually passing an ip param in the advanced options.
January 29, 20188 yr You can also set a diffrent gateway for eth1 in the network settings, then custom networks will be created automatically.
January 29, 20188 yr 21 hours ago, theiam79 said: Alright, so I set up an IP alias for my lan in pfsense, and set eth1 to use that. After deleting and restarting docker the container still used 192.168.1.2 as the gateway. I tried manually deleting and creating the network with the new gateway, and got an error about it already being in use. I then created a second alias on pfsense and made a custom network specifying that as the gateway, and then choosing that and manually passing an ip param in the advanced options. @bonienl Edited January 30, 20188 yr by theiam79
February 1, 20188 yr @bonienl Tried messing with it some tonight, wanted to see if using a bridge instead of directly connecting to eth1 made a difference. Unfortunately it did not. From the link you provided it looks like I should be able to use both NICS on the same subnet as long as they point to different gateways, but my container is still taking 192.168.1.2 as the gateway with eth1 set to use 192.168.1.11. Any other thoughts as to what could be the cause? I'd really prefer not to have to go to a different subnet as I currently have this reverse proxied and don't want to break that.
February 1, 20188 yr 4 hours ago, theiam79 said: @bonienl Tried messing with it some tonight, wanted to see if using a bridge instead of directly connecting to eth1 made a difference. Unfortunately it did not. From the link you provided it looks like I should be able to use both NICS on the same subnet as long as they point to different gateways, but my container is still taking 192.168.1.2 as the gateway with eth1 set to use 192.168.1.11. Any other thoughts as to what could be the cause? I'd really prefer not to have to go to a different subnet as I currently have this reverse proxied and don't want to break that. unRAID 6.4.1-rc2 was released. This version allows you to use an interface without IP assignment. You can change the network settings of eth1 to "none" and under Docker settings create the network for Docker on eth1.
February 1, 20188 yr 1 hour ago, zin105 said: So is it possible to put containers on a seperate NIC but still use the same gateway and IP range as the primary unRAID NIC in RC2? Yes that is possible. Steps to do: 1. Configure the new NIC without IP addresses (network settings) 2. Exclude eth0 (br0) from Docker networks (docker settings) 3. Configure IP address, gateway and DHCP pool (optional) for Docker networks on the new NIC (docker settings)
February 1, 20188 yr Can I leave some containers on br0 and then use eth1 for others if I point out to a different gateway on the same subnet?
February 1, 20188 yr 1 minute ago, theiam79 said: Can I leave some containers on br0 and then use eth1 for others if I point out to a different gateway on the same subnet? Yes that is possible, but you need to cofigure your router to have two gateway addresses
February 4, 20188 yr I seem to be at a total loss. Back to the original question in this thread.... Is there a guide? I'm on 6.4.0 currently (I hear preclear is broken on 6.4.1 so I'm waiting a but because I'm due for a few new drives). I have br0, in the pihole docker I thought I could select br0 and then set the ip to something else (192.168.1.89 in my case which is outside the dhcp range on my router). But it tells me port 80 is in use. Sorry for the parentheticals (I've been imbibing).
February 4, 20188 yr When using custom docker networks, you need to remove all the Port mapping assignments in the docker config page (might need to use advanced view to get them all)
February 4, 20188 yr 3 minutes ago, ken-ji said: When using custom docker networks, you need to remove all the Port mapping assignments in the docker config page (might need to use advanced view to get them all) Ok thanks. I went in and looked at the Docker settings and see I had nothing selected next to "DHCPv4 pool of custom network br0 (optional):". So I selected it for 192.168.1.0/25 (128 hosts). Now when I set the IP in pihole to 192.168.1.89 I get the same thing. Unraid is on 192.168.1.69 Quote listen tcp 0.0.0.0:80: bind: address already in use.
Archived
This topic is now archived and is closed to further replies.