elmerfds / rebuild-dndc

Re-create containers that use another container's network stack (i.e. routing container traffic through a VPN container)
GNU General Public License v3.0
22 stars 8 forks source link

Not detecting all in-scope conatainers #57

Open aussiehuddo opened 2 years ago

aussiehuddo commented 2 years ago

Have setup on Unraid with --net=container:master_container_name in extra parameters for 5 containers, but Rebuild-DNDC only detects 2 of them. Not sure why...

ghost commented 2 years ago

I think I have the same issue. Rebuild-DNDC fails to detect any of the containers I have routed through my vpn container. I followed the readme when setting up all the relevant containers. I do however get an alert in the logs when running the container, see below.

This is the log output from Rebuild-DNDC after starting up:

[------------------ CONFIG CHECK ------------------]

- Discord webhook not set
- Discord notifications disabled
- Master container name set: gluetun_vpn
- Ping count specified: 4
- Ping IP specified: 1.1.1.1
- Ping IP alt set: 8.8.8.8
- Master container connectivity check enabled
- Sleep secs set: 10
- CRON schedule set: */5 * * * *
- Save no of master cotnainer IDs, default - 5
- No containers set for manual run
- Run at startup: yes
- CRON job has been set
- Running at startup now...

---------------------------------
Rebuild-DNDC v4.0.7-u
---------------------------------

-----------------------------------------------------------------------------------
# MASTER CONTAINER INFO
- CONTAINER-NAME: gluetun_vpn
- ENDPOINT-ID: 1126a5cc4fcd78c6d60f86e673652fb6ca64e33355960b8ad34eccd55bbf5154
- NETMODE-ID: 661b2d5a794d4c3549e64be2c1baaf760d672b105585cd7b84c255f77ad31249
- CONNECTIVITY: OK
-----------------------------------------------------------------------------------

A. SKIPPING: FIRST RUN SETUP
B. ALERT: MASTER container ENDPOINTID DOESN'T MATCH
- REBUILDING: gluetun_vpn container ENDPOINTID DOESN'T MATCH

C. DETECTING: IN-SCOPE CONTAINERS

# RESULTS: None in-scope, checking for previous in-scope containers

- No containers in scope.
- Make sure you have the containers routed through the MASTER container are running fine first.

--------------------------------------------
Run Completed: Sat Nov 6 20:47:05 CET 2021
--------------------------------------------

Edit: formatting

Rkpaxam commented 8 months ago

same here: extra parameters set up correctly

Author: https://github.com/elmerfdz Support: https://github.com/elmerfdz/unRAIDscripts

[------------------ CONFIG CHECK ------------------]


Rebuild-DNDC v4.0.7-u


MASTER CONTAINER INFO

A. SKIPPING: FIRST RUN SETUP B. SKIPPING: MASTER CONTAINER ENDPOINTID IS CURRENT C. DETECTING: IN-SCOPE CONTAINERS

RESULTS: None in-scope, checking for previous in-scope containers

D. PROCESSING: IN-SCOPE CONTAINERS

ajatoledo commented 2 months ago

I encountered a similar issue where rebuild-dndc didn't detect all containers using my Gluetun VPN container for networking. I found a workaround that might help others facing the same problem. Here are the steps I followed:

Workaround Steps:

Warning: The steps below temporarily change network settings away from the VPN, there is a risk of IP and DNS leaks. Please disable any sensitive services as needed during this process.

  1. Open Docker Menu in UnRaid:

    • Select the container that isn't being detected by rebuild-dndc and click Edit to open the configuration window.
  2. Enable Advanced View:

    • In the upper right-hand corner of the configuration window, flip the toggle to Advanced View.
  3. Temporary Network Change:

    • Change Network Type to any of your network interfaces temporarily. In my setup, I use bonded NICs with a VLAN, so I selected br0.10. For anyone using bonded nics but no VLANs, select the bond, e.g., br0; for non-bonded connections, select the network interface, e.g., eth0. Note that the container will start up using the interface's IP, so disable/delay any services as needed.
  4. Clear Extra Parameters:

    • Clear the Extra Parameters field.
  5. Apply Settings:

    • Click Apply to apply the updated settings to the container.

Reconfigure Container:

After applying the above updates, repeat steps 1-3 and then apply the following configuration updates to the container:

  1. Set Network Type to None:

    • Change Network Type to None.
  2. Update Extra Parameters:

    • Update Extra Parameters to the container network. For me, it is --network=container:GluetunVPN.
  3. Apply Final Settings:

    • Click Apply to apply the updated settings to the container.

Results:

After completing these steps, rebuild-dndc logs show my previously undetected container. Restarting the Gluetun container triggers a rebuild of my containers as expected.

This workaround seems to be a one-time fix for each undetected container. While it's a bit tedious, it effectively resolves the detection issue.

Hope this helps others experiencing the same issue!