Hello,
I have super strange issue related to that, I cannot allow the communication between docker host (RPi4/LibreELEC) and the containers. I'm using macvlan interfaces, because I intend to run tvheadend as docker container, and because of multicast I know this should be running as macvlan interface on the network.
So let's go back to the issue, what I have till now..
Docker is already installed, up and running, here I have two containers, the first one is portainer, but it is connected to default network of docker, and the second one is simple linux appliance connected to macvlan network,
Kodi:~ # docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
92e2f31075f9 treehouses/php-apache "docker-php-entrypoi…" About an hour ago Up About an hour tvgo.home.lan
d2f942d56e92 portainer/portainer "/portainer --ssl --…" About an hour ago Up About an hour 0.0.0.0:80->8000/tcp, 0.0.0.0:443->9000/tcp portainer.home.lan
Kodi:~ #
Kodi:~ # docker inspect tvgo.home.lan
"Networks": {
"vlan6": {
"IPAMConfig": {
"IPv4Address": "192.168.40.6"
},
"Links": null,
"Aliases": [
"92e2f31075f9"
],
"NetworkID": "ef1db953a73d94f3137bc749360aaf172f1b37eb58aa72191e9d549c9376e74d",
"EndpointID": "58958165ee388cad196cc13199ac7ce10819736e1912a42b16b9e436c25afc8d",
"Gateway": "192.168.40.1",
"IPAddress": "192.168.40.6",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:c0:a8:28:06",
"DriverOpts": null
Display More
Kodi:~ # docker network list
NETWORK ID NAME DRIVER SCOPE
3542aa40e26a bridge bridge local
406d6d8a43aa host host local
76a7e1c010c9 lsio bridge local
f898c4c0c3e1 none null local
ef1db953a73d vlan6 macvlan local
Kodi:~ #
Kodi:~ # docker network inspect vlan6
[
{
"Name": "vlan6",
"Id": "ef1db953a73d94f3137bc749360aaf172f1b37eb58aa72191e9d549c9376e74d",
"Created": "2020-04-19T17:52:33.8635077+03:00",
"Scope": "local",
"Driver": "macvlan",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "192.168.40.0/24",
"Gateway": "192.168.40.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"92e2f31075f9fc02a6f3e4368709266832cb979a78ca573c929c3e16ec048214": {
"Name": "tvgo.home.lan",
"EndpointID": "58958165ee388cad196cc13199ac7ce10819736e1912a42b16b9e436c25afc8d",
"MacAddress": "02:42:c0:a8:28:06",
"IPv4Address": "192.168.40.6/24",
"IPv6Address": ""
}
},
"Options": {
"parent": "eth0"
},
"Labels": {}
}
]
Kodi:~ #
Display More
Here I have this one,
/usr/sbin/ip link add macvlan link eth0 type macvlan mode bridge
/usr/sbin/ip addr add 192.168.40.3/32 dev macvlan
/usr/sbin/ip link set macvlan up
/usr/sbin/ip route add 192.168.40.5/32 dev macvlan
/usr/sbin/ip route add 192.168.40.6/32 dev macvlan
I used this guide to create this configuration:
Using Docker macvlan networks · The Odd Bit
And this works on my lab environment, but when I try to replicate it on RPi4/LibreELEC, it simply doesn't' work
Kodi:~ # ping 192.168.40.6
PING 192.168.40.6 (192.168.40.6): 56 data bytes
^C
--- 192.168.40.6 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss
Kodi:~ #
If I try to ping the same address from different host on my network, it works...
C:\Users\KpuCko>ping 192.168.40.6
Pinging 192.168.40.6 with 32 bytes of data:
Reply from 192.168.40.6: bytes=32 time<1ms TTL=63
Reply from 192.168.40.6: bytes=32 time<1ms TTL=63
Reply from 192.168.40.6: bytes=32 time<1ms TTL=63
Reply from 192.168.40.6: bytes=32 time<1ms TTL=63
Ping statistics for 192.168.40.6:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Users\KpuCko>
Display More
So please tell me, what I'm missing..
Thanks a lot!
Aa, maybe I forgot to show you the IP address and routing information of RPi box,
Kodi:~ # ifconfig
br-76a7e1c010c9 Link encap:Ethernet HWaddr 02:42:8F:4A:BD:23
inet addr:172.18.0.1 Bcast:172.18.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:390 errors:0 dropped:0 overruns:0 frame:0
TX packets:451 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:386092 (377.0 KiB) TX bytes:396766 (387.4 KiB)
docker0 Link encap:Ethernet HWaddr 02:42:7D:13:EC:92
inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:370 errors:0 dropped:0 overruns:0 frame:0
TX packets:379 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:420418 (410.5 KiB) TX bytes:259020 (252.9 KiB)
eth0 Link encap:Ethernet HWaddr DC:A6:32:5A:60:D7
inet addr:192.168.40.4 Bcast:192.168.40.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8734858 errors:0 dropped:0 overruns:0 frame:1
TX packets:1197515 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4044581731 (3.7 GiB) TX bytes:150729122 (143.7 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:79 errors:0 dropped:0 overruns:0 frame:0
TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8848 (8.6 KiB) TX bytes:8848 (8.6 KiB)
macvlan Link encap:Ethernet HWaddr 42:87:11:92:C4:D1
inet addr:192.168.40.3 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:878 errors:0 dropped:0 overruns:0 frame:0
TX packets:569 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:54466 (53.1 KiB) TX bytes:281356 (274.7 KiB)
veth08bcef3 Link encap:Ethernet HWaddr 3A:E4:B2:C5:C2:79
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:370 errors:0 dropped:0 overruns:0 frame:0
TX packets:379 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:425598 (415.6 KiB) TX bytes:259020 (252.9 KiB)
Kodi:~ #
Display More
Kodi:~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.40.1 0.0.0.0 UG 0 0 0 eth0
8.8.4.4 192.168.40.1 255.255.255.255 UGH 0 0 0 eth0
8.8.8.8 192.168.40.1 255.255.255.255 UGH 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 macvlan
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
172.18.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br-76a7e1c010c9
192.168.40.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.40.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
192.168.40.6 0.0.0.0 255.255.255.255 UH 0 0 0 macvlan
Kodi:~ # ip route show
default via 192.168.40.1 dev eth0
8.8.4.4 via 192.168.40.1 dev eth0
8.8.8.8 via 192.168.40.1 dev eth0
169.254.0.0/16 dev macvlan scope link src 169.254.173.158
172.17.0.0/16 dev docker0 scope link src 172.17.0.1
172.18.0.0/16 dev br-76a7e1c010c9 scope link src 172.18.0.1
192.168.40.0/24 dev eth0 scope link src 192.168.40.4
192.168.40.1 dev eth0 scope link
192.168.40.6 dev macvlan scope link
Kodi:~ #
Display More
So I expect I'm able to learn the MAC address from macvlan interface for 192.168.40.6, unfortunately I can't
Kodi:~ # arp -a
? (192.168.40.5) at 52:44:54:ba:46:15 [ether] on eth0
? (192.168.40.1) at 00:22:bd:38:b4:c5 [ether] on macvlan
? (172.18.0.2) at 02:42:ac:12:00:02 [ether] on br-76a7e1c010c9
? (192.168.40.6) at <incomplete> on eth0
? (172.17.0.2) at 02:42:ac:11:00:02 [ether] on docker0
? (192.168.40.6) at <incomplete> on macvlan
? (192.168.40.1) at 00:22:bd:38:b4:c5 [ether] on eth0
Kodi:~ #