Carlo Lobrano <[email protected]> writes: > Hi everybody, > > I tried the steps Bjørn suggested and it worked, even if I'm not sure about > some points. > > Firstly, I can get the address of api.ipify only if the eth (or another > connection) is still up, not sure if this is expected or you got that IP > from one of the mbim connections. > > Secondly, and more important, I can't figure out how to configure routing > tables.
Well, this is really a question related to dealing with multiple network interfaces in general. The answers depends on what you have at each end, and how yout want to connect it. Some possible solutions are - single routing table with non-default routes out the appropriate interfaces - multiple routing tables with default routes, using ip rules to select the appropriate table - VRF lite: https://www.kernel.org/doc/Documentation/networking/vrf.txt and probably more... > I googled a lot, the most interesting solutions consider adding new > tables in /etc/iproute2/rt_tables and configuring the sessions gateway > separately in each table, Yes, that's one possibility, mostly suitable if you can create simple source address based rules to select one table or the other. Note that you don't really have to add any symbolic names to rt_tables for testing this. You can use table numbers directly. > and some rules to route the appropriate range of > IPs to the right table, but still I can not ping any other address. > Following is my last configuration attempt, any hint is appreciated. > > Note that I had to use the main NET and only 1 vlan (with ID different from > 4096) for other constraints > > $ ip route list > 5.92.161.0/24 dev wwp0s20u1u2u4 proto kernel scope link src > 5.92.161.124 > 10.62.211.0/24 dev wwp0s20u1u2u4.0 proto kernel scope link src > 10.62.211.182 > > $ ip route list table table1 > default via 5.92.161.1 dev wwp0s20u1u2u4 > 5.92.161.0/24 dev wwp0s20u1u2u4 scope link > > $ ip route list table table2 > default via 10.62.211.1 dev wwp0s20u1u2u4.0 > 10.62.211.0/24 dev wwp0s20u1u2u4.0 scope link There are no layer 2 addresses on MBIM, so you can simplify these to $ ip route list table table1 default dev wwp0s20u1u2u4 $ ip route list table table2 default dev wwp0s20u1u2u4.0 Not that it matters. Just to keep things as simple as possible. > $ ip rule > 0: from all lookup local > 32763: from 10.62.211.0/24 lookup table2 > 32764: from 5.92.161.0/24 lookup table1 > 32765: from 5.91.109.0/24 lookup table1 > 32766: from all lookup main > 32767: from all lookup default So with these rules in place, you should be able to do ping -I 5.92.161.124 8.8.8.8 ping -I 10.62.211.182 8.8.8.8 and the two pings would go out on wwp0s20u1u2u4 and wwp0s20u1u2u4.0 respectively. But whether this is what you want is another question. Juggling multiple default routes is tricky. But if there is a distinct dependency between source adress and outgoing interface, then your solution is suitable. The remaining issue is of course that you have to be explicit about source address selection everywhere... Bjørn _______________________________________________ ModemManager-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
