shim-br0 networs in unraid


Recommended Posts

44 minutes ago, L0rdRaiden said:

what added them

This will help:

 

shim-br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.200  netmask 255.255.255.255  broadcast 0.0.0.0
shim-br0.50: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.50.128  netmask 255.255.255.255  broadcast 0.0.0.0

 

Link to comment

shim networks are created when the Docker setting "Host access to custom networks" is enabled.

This allows Unraid to talk directly with docker containers, which are using macvlan (custom) networks.

Docker does not allow this direct communication, and network trickery is done to bypass the restriction.

 

Here is an example of my network

 

image.thumb.png.e7689b4091690ffafc323551b1d3e965.png

Edited by bonienl
  • Thanks 1
Link to comment
  • 3 months later...
  • 4 weeks later...
  • 5 months later...
  • 2 months later...

I run into this same problem time and time again. Every so often my server suffers from a kernel panic. Once it reboots, the routing tables and docker networks are missing. Even if I disable/enable Docker the routing tables don't get added back. Usually a reboot fixes it, but not always.

 

This is what the routing tables should be when correct

 

# ip route show
default via 192.168.1.1 dev br0
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.0.0/16 via 192.168.0.2 dev tun0
192.168.0.2 dev tun0 proto kernel scope link src 192.168.0.1
192.168.1.0/25 dev shim-br0 scope link
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.100
192.168.1.128/25 dev shim-br0 scope link
192.168.3.0/25 dev shim-br0.3 scope link
192.168.3.128/25 dev shim-br0.3 scope link
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown

 

And this is what it looks like when things are broken

 

default via 192.168.1.1 dev br0
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.0.0/16 via 192.168.0.2 dev tun0
192.168.0.2 dev tun0 proto kernel scope link src 192.168.0.1
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown

 

Adding the route manually throws an error, as the device doesn't exist. For example

# ip route add 192.168.3.0/25 dev shim-br0.3
Cannot find device "shim-br0.3"

 

Any ideas how I can prevent this from happening? Or how I can correctly add these routing tables myself?

Link to comment
  • 4 weeks later...

Just wanted to provide an update.

 

I haven't gotten to the bottom of why the network (and routing tables) suddenly disappear, but when it happens I'm able to fix it with the following commands (I reverse engineered the /etc/rc.d/rc.docker script)

 

ip link add shim-br0 link br0 type macvlan mode bridge
ip link set shim-br0 up
ip route add 192.168.1.0/25 dev shim-br0 
ip route add 192.168.1.128/25 dev shim-br0

 

Hopefully this helps someone else fix the issue in the future.

 

Edit:

 

And for those using ipvlan

 

ip link add shim-br0 link br0 type ipvlan mode l3
ip link set shim-br0 up
ip route add 192.168.1.0/25 dev shim-br0 
ip route add 192.168.1.128/25 dev shim-br0

 

Edited by acook
  • Like 1
  • Thanks 2
  • Upvote 2
Link to comment
  • 10 months later...
On 6/9/2021 at 5:29 AM, acook said:

Just wanted to provide an update.

 

I haven't gotten to the bottom of why the network (and routing tables) suddenly disappear, but when it happens I'm able to fix it with the following commands (I reverse engineered the /etc/rc.d/rc.docker script)

 

ip link add shim-br0 link br0 type macvlan mode bridge
ip link set shim-br0 up
ip route add 192.168.1.0/25 dev shim-br0 
ip route add 192.168.1.128/25 dev shim-br0

 

Hopefully this helps someone else fix the issue in the future.

Thaaaaaaaaaaaaaaank Youuuu 🙂
I am so happy that you posted this.

Link to comment
  • 4 months later...
On 6/8/2021 at 8:29 PM, acook said:

Just wanted to provide an update.

 

I haven't gotten to the bottom of why the network (and routing tables) suddenly disappear, but when it happens I'm able to fix it with the following commands (I reverse engineered the /etc/rc.d/rc.docker script)

 

ip link add shim-br0 link br0 type macvlan mode bridge
ip link set shim-br0 up
ip route add 192.168.1.0/25 dev shim-br0 
ip route add 192.168.1.128/25 dev shim-br0

 

Hopefully this helps someone else fix the issue in the future.

Thank you, it works like a charm! is there anyway I can prevent this happen again; I have to manually type this in each time I restart the Unraid server.

 

Wing

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.