Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know a bit about programming sockets in c in Linux. Now I've got two NICs:
eth0 with 192.168.1.100 and
eth1 with 192.168.1.101 .
I want to send two datagrams to an internetlocation. One datagram over eth0 and the other over eth1. But they always go over eth0 because the default gateway is set like this. ( route add default gw 192.168.0.1 eth0) .
I tried to do it the way a DHCP-client send its packets, but then the other site won't recognize my packets as UDP/IP anymore.
Do you think it is possible without reprogramming the kernel?
I think the kernel controls the contents of the ethernet header.
Where are you sending the packets? This is what will decide the route they take. As eth0 and eth1 are both on the same subnet why do you want to use a specific interface?
Well, the real situation is a bit more complex, it's about ESS transition :
I've got two wireless NIC's and when one is busy sending (VoIP) the other should find a better AP and connect to that ESS (ESS of eth0 can be different than that of eth1), and then the VoIP should also go over that other NIC, but the routing table in Linux takes two seconds to have effect. So after I do route add default gw 192.168.0.1 eth1 , it takes two seconds before the VoIP packets go over eth1.
Sounds to me like you want to look into some of the QoS and advanced routing stuff. You can load balance the links or route packets on their type/mark/anything you want really.
No, I just want to walk downtown and call someone over WLAN. And when I walk away my other NIC should pick up a better connection (To another AP with probably a different ESSID.) And when this new connection is made the Voice traffic should go over it at once. I don't want to wait 2 seconds before the routing table has its effect.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.