0

I have set up a macvlan (mode bridge) on a Tinker Board (using Armbian). The device (eth0.1) has been set up so that it can bind to qbittorrent

My router forwards all incoming traffic to port 19489 to this macvlan device, which has been assigned an IP 192.168.99.64

Connections are never established except when I am monitoring this device with:

tcptrack -i eth0.1

When the device is being monitored, connections are established and qbittorrent works perfectly. But when I stop monitoring existing connections continue until they are closed, but no new connections are established.

This is my routing table:

default via 192.168.99.1 dev eth0 proto dhcp metric 100
default via 192.168.99.1 dev wlp1s0 proto dhcp metric 600
default via 192.168.99.1 dev eth0.1 proto dhcp metric 1001
169.254.0.0/16 dev wlp1s0 scope link metric 1000
192.168.99.0/24 dev eth0 proto kernel scope link src 192.168.99.61 metric 100
192.168.99.0/24 dev wlp1s0 proto kernel scope link src 192.168.99.62 metric 600
192.168.99.0/24 dev eth0.1 proto kernel scope link src 192.168.99.64 metric 1001

Somehow I would like to get this working without having to monitor the device to achieve this. Any ideas?

(In the meantime I've set up a bash script with tcptrack to start after the qbittotrrent service starts. Everything is working perfectly, but somehow this workaround seems a little dumb)

Dzseti
  • 101

1 Answers1

0

Thanks @A.B

Following this article I managed to get qbittorrent working in a namespace called 'air' and accepting incoming connections. The answer by Yun Wu refers to this article, which gives a very good explanation of the different types of macvlan (and other) network setups. I came to the conclusion that macvlan - even in a namespace - would be difficult to get to work after reading this article and so followed the logic of the original question and the second answer by dirkt without using macvlan.

I did need to make one change to get the network working: in setting up the default route from the 'air' namespace device I didn't specify the IP of the bridge, but rather the same gateway as the physical device uses. So my final working setup was as follows:

ip netns add air
ip netns exec air ip link set lo up
ip link add veth1 type veth peer name br-veth1
ip link set veth1 netns air
ip netns exec air ip addr add 192.168.99.64/24 dev veth1
ip link add name br0 type bridge
ip link set br0 up
ip link set br-veth1 up
ip netns exec air ip link set veth1 up
ip link set br-veth1 master br0
ip link set eth0 master br0
ip addr add 192.168.99.63/24 brd + dev br0
ip netns exec air ip route add default via 192.168.99.1

With this 192.168.99.64/24 in the 'air' namespace is pingable from the local network and my main router nicely forwards external incoming traffic referring to my qbittorrent port to this IP and connections are established without a problem

Dzseti
  • 101