An elegant solution for an annoying problem. Thank you.<br><br><div class="gmail_quote">On Mon, Mar 9, 2009 at 10:51 AM, Helge Hafting <span dir="ltr">&lt;<a href="mailto:helge.hafting@hist.no">helge.hafting@hist.no</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Bringing up one interface creates a default route, which is necessary no<br>
matter which interface is used.<br>
<br>
Bringing up both interfaces makes two default routes, and there is the<br>
risk that the phone ends up using the slower interface which obviously<br>
is a problem.<br>
<br>
I set up /etc/network/interfaces like this, adapted from SHR:<br>
<br>
auto usb0<br>
iface usb0 inet static<br>
        address 192.168.0.202<br>
        netmask 255.255.255.0<br>
        network 192.168.0.0<br>
        gateway 192.168.0.200 metric 1<br>
        up echo nameserver 208.67.222.222 &gt;&gt; /etc/resolv.conf<br>
        up echo nameserver 208.67.220.220 &gt;&gt; /etc/resolv.conf<br>
<br>
The &quot;metric&quot; does the trick. When usb0 is the only interface, the usb0<br>
route gets used as usual.<br>
<br>
If some other interface comes up (in my case, eth0)<br>
then that one gets a default route too, but that default route<br>
comes up with the default metric of 0.<br>
<br>
So, the eth0 default route is seen as &quot;shorter&quot;, and is preferred over<br>
usb0 when both are available. Which is good, as eth0 is faster.<br>
<br>
So, no need to delete the usb0 default route when bringing up other<br>
interfaces, with the associated problem of restoring the usb0 route when<br>
the other interface goes away.<br>
<br>
Helge Hafting<br>
<br>
_______________________________________________<br>
Openmoko community mailing list<br>
<a href="mailto:community@lists.openmoko.org">community@lists.openmoko.org</a><br>
<a href="http://lists.openmoko.org/mailman/listinfo/community" target="_blank">http://lists.openmoko.org/mailman/listinfo/community</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>---------------------------------------------------------<br>Atilla Filiz<br>Eindhoven University of Technology<br>Embedded Systems, Master&#39;s Programme<br>--------------------------------------------------------<br>