On Ubuntu 14.04 x86-64 I have a wireless broadband connection and a USB tethered one (it's on 4G, not the same wireless):
route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.42.129 0.0.0.0 UG 0 0 0 usb0 192.168.0.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan1 192.168.42.0 0.0.0.0 255.255.255.0 U 1 0 0 usb0
I have then the following also:
ifconfig ... usb0 Link encap:Ethernet HWaddr 02:36:2c:04:05:7c inet addr:192.168.42.248 Bcast:192.168.42.255 Mask:255.255.255.0 inet6 addr: fe80::36:2cff:fe04:57c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3367 errors:1 dropped:0 overruns:0 frame:1 TX packets:3669 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2434689 (2.4 MB) TX bytes:637911 (637.9 KB) wlan1 Link encap:Ethernet HWaddr 14:cc:20:75:e1:8d inet addr:192.168.0.4 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::16cc:20ff:fe75:e18d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3806 errors:0 dropped:0 overruns:0 frame:0 TX packets:4110 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2283536 (2.2 MB) TX bytes:583794 (583.7 KB)
It all looks like it's supposed to be working as intended (i.e. both network connections are up, my machine got 2 IPs, ...).
Then I wanted to use the bind shim to force processes on one connection (or another) and those only work when I specify the IP of the default connection/gateway.
The following works (please note this is on the tethered USB - 4G):
BIND_ADDR="192.168.42.248" LD_PRELOAD=./bind.so chromium-browser
And this doesn't (my broadband):
BIND_ADDR="192.168.0.4" LD_PRELOAD=./bind.so chromium-browser
Of course, when I unplug the USB phone, wlan0 magically starts working again...
What am I doing wrong? Any idea?