Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

99-ccu-shim-network script doesn't work #2556

Closed
Mutantpenguin opened this issue Dec 11, 2023 · 6 comments
Closed

99-ccu-shim-network script doesn't work #2556

Mutantpenguin opened this issue Dec 11, 2023 · 6 comments
Labels
🐛 bug-report Something isn't working 🧊 stale Ticket is in a stale state (about to be closed)

Comments

@Mutantpenguin
Copy link

Describe the issue you are experiencing

I am running RaspberryMatic in Docker and used the automatic setup via script from https://raspberrymatic.de/install-docker.sh.

The network script 99-ccu-shim-network doesn't work for me, but I am unsure why. I know this, because pinging the docker container from the host (or another container) does not work. I need this functionality to integreate RaspberryMatic with HomeAssistant.

If I run the commands from 99-ccu-shim-network manually everything works fine. I don't mean the whole script, but just the following lines (adjusted for my IPs):

ip link add ccu-shim link ${CCU_NETWORK_INTERFACE} type macvlan mode bridge
ip addr add ${CCU_CONTAINER_IP_AUX} dev ccu-shim
ip link set ccu-shim up
ip route add ${CCU_CONTAINER_IP} dev ccu-shim protocol static

I am more than willing to debug this on my own, but would need a little help to get started as I never did something like that.

Describe the behavior you expected

A working network shim interface

Steps to reproduce the issue

  1. Reboot
  2. Wait for all docker containers to be up and running
  3. Try to ping the container from the host.

What is the version this bug report is based on?

3.73.9.20231130

Which base platform are you running?

rpi3 (RaspberryPi3)

Which HomeMatic/homematicIP radio module are you using?

HmIP-RFUSB

Anything in the logs that might be useful for us?

Sorry, I don't have access to them at this moment and will upload the logs later.

Additional information

No response

@Mutantpenguin Mutantpenguin added the 🐛 bug-report Something isn't working label Dec 11, 2023
@Mutantpenguin
Copy link
Author

I feel dumb.

Do I understand it correctly that I can test these script just by bringing the interface down and up again by doing the following?

ifconfig eth0 down
ifconfig eth0 up

@jens-maus
Copy link
Owner

jens-maus commented Dec 11, 2023

This sounds like the ifupdown package might not be installed on your host machine (where you run docker). So please check if this package is installed. Thus, something like:

sudo apt-get install ifupdown 

if you are using debian/ubuntu host.

@Mutantpenguin
Copy link
Author

Thanks for the tip, but that didn't help since ifupdown is already installed.

Neither did my experiments with putting some echo statements into the script and using ifconfig eth0 down/up to test it. This didn't output anything at all and didn't bring up the ccu-shim.

I should have written, that I am using Raspbian Bullseye, because I think that might explain my situation after doing some research on this topic:

  • Raspbian seems to use dhcpcd and not ifupdown which means it ignores all the scripts in /etc/network/if-up.d/. At least that's my rough understanding of the situation.

Calling the script like it's done in install-docker.sh works totally fine btw:

IFACE="eth0" /etc/network/if-up.d/99-ccu-shim-network

@tp1de
Copy link

tp1de commented Jan 5, 2024

I do have the same behavior since I upgraded to bookworm on my raspberry pi 4 with docker.

Everything works fine: raspberrymatic and iobroker. Just the shim network is not initialised when rebooting.
Manual commands executed in shell work fine - just the script is not executed anymore. (ifupdown is installed)

I now just included the 4 lines within /etc/rc.local - This is at least working while rebooting

@jens-maus @Mutantpenguin : Is there any "better" solution?

@Mutantpenguin
Copy link
Author

The only other solution I know of would be to write your own systemd file for this. But I wouldn't call this "better".
You can read about this here #1373 (comment)

I don't really know much about networking, so I don't know what would be the correct solution.But it seems like the so called dhcpcd-run-hooks are the preferred solution on raspbian:
https://manpages.ubuntu.com/manpages/bionic/man8/dhcpcd-run-hooks.8.html

Attention, the mentioned paths there are not correct. For me (on bullseye) it's /etc/dhcp/dhclient-enter-hooks.d.

In an ideal world, the run-docker.sh wouldn't even create the file 99-ccu-shim-network on raspbian bullseye.

@jens-maus If you are able to give me any hints if the mentioned dhcpcd-run-hooks are the correct way of solving this I will try my hands on a pull request.

Copy link
Contributor

github-actions bot commented Apr 6, 2024

There hasn't been any activity on this issue recently. To keep our backlog manageable we have to clean old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest RaspberryMatic version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the 🧊 stale Ticket is in a stale state (about to be closed) label Apr 6, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug-report Something isn't working 🧊 stale Ticket is in a stale state (about to be closed)
Projects
None yet
Development

No branches or pull requests

3 participants