I am developing a Debian 8 system that has two network interfaces (one ethernet and one 3G modem) and is supposed to have two simultaneous connections to an MQTT broker i.e. there should be a connection via both interfaces. The language I am using is Python and the MQTT client is Paho.Supplying Paho's connect-method with argument called bind_address should do extacly what I want. I would just create two instances of Paho and give them the IP addresses of my two interfaces.The problem is that only one of them gets connected.I have tried pinging the broker IP specifying the interface explicitly (ping -I ifname a.b.c.d) and that works with both interfaces. Also, giving the two instances of Paho the same IP, the one of ethernet, works.At this point, my guess is that this problem is related to routing, but that's an area I am not very familiar with. How can I fix this?Output of ip addr as requested:1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00    inet 127.0.0.1/8 scope host lo       valid_lft forever preferred_lft forever    inet6 ::1/128 scope host       valid_lft forever preferred_lft forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000    link/ether 00:04:25:18:e9:a9 brd ff:ff:ff:ff:ff:ff    inet 82.195.211.80/23 brd 82.195.211.255 scope global eth0       valid_lft forever preferred_lft forever    inet6 fe80::204:25ff:fe18:e9a9/64 scope link       valid_lft forever preferred_lft forever3: sit0@NONE: <NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN group default    link/sit 0.0.0.0 brd 0.0.0.0    inet6 ::127.0.0.1/96 scope host       valid_lft forever preferred_lft forever4: wwan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000    link/ether 0a:71:b0:b9:ca:39 brd ff:ff:ff:ff:ff:ff    inet 10.36.124.58/30 brd 10.36.124.59 scope global wwan0       valid_lft forever preferred_lft forever    inet6 fe80::871:b0ff:feb9:ca39/64 scope link       valid_lft forever preferred_lft foreverOutput of ip route as requested:default via 82.195.210.1 dev eth0  metric 202default via 10.36.124.57 dev wwan0  metric 204default via 82.195.210.1 dev eth0  proto static  metric 102410.36.124.56/30 dev wwan0  proto kernel  scope link  src 10.36.124.58  metric 20410.36.124.58 via 127.0.0.1 dev lo  metric 20482.195.210.0/23 dev eth0  proto kernel  scope link  src 82.195.211.80  metric 20282.195.211.80 via 127.0.0.1 dev lo  metric 202
Connecting to same IP via two network interfaces at the same time
debian;routing;network interface
Simple source policy routing would probably solve your problem. Create a new routing table called mobile with an arbitrary unused number (100 here; this is optional, you could just use the number instead):echo 100 mobile >> /etc/iproute2/rt_tablesSet this table to route towards your 3G gateway:ip route add default via 10.36.124.57 dev wwan0 table mobileip route flush cacheFinally, add the rule for your 3G source address to use the newly setup mobile table:ip rule add from 10.36.124.58 table mobileI took the interface name (wwan0) and the addresses from your question. The interface name can be reasonably expected to stay stable (at least until you attach another 3G modem to your computer), but the local and gateway address may change on every connection. You'll probably want to script this setup.