Does routing affect a socket with a bound source address?
问题 Let's say I have two network interfaces: eth0 with address 10.0.0.1 eth1 with address 192.168.0.1 Using route or ip route add I have set it to route: All addresses to eth0 1.2.3.4 only to eth1 So packets to 1.2.3.4 should be routed to eth1 , and everything else to eth0 . I then create a UDP socket and use bind() to set its local address to 192.168.0.1 . Then I send a packet to 1.2.3.4 . Will it be be sent over eth1 per the routing table or eth0 because it is bound to that IP address? I tried,