Re: Re: how network-manager chose connection?



On Thu, 2010-07-15 at 09:02 +0200, Markus Becker wrote:
> > On Wed, 2010-07-07 at 14:26 +0200, Pierre-Marie Coron wrote:
> > > Hello everybody,
> > > 
> [...]
> > 
> > At the moment the order can't be changed, it's a function of the
> > "default route" that is set, either by NM or (if you don't use NM)
> > normal system networking scripts.  It all depends on which connection is
> > started, either  manually by you, or automatically by NM.
> > 
> > NM will autostart the last-used connection by default if it's wired or
> > wifi.  When multiple connections are active, the ordering is wired >
> > wifi > 3G.
> 
> Hi Dan,
> 
> some time back in the times of NetworkManager in SVN, we made some 
> modifications to NetworkManagerPolicy, so that it exposes the priority of 
> connections/devices/device types (don't remember which one) over DBUS, so that 
> a user (program) could change the priority and initiate an update of the 
> routing and DNS. Are you interested in applying that to git? If yes, then I 
> would start digging it out.

Possibly, but I tend to think this is the wrong approach for these
situations.  If we step back and ask "what exactly is the user trying to
do" (like you explained earlier above with different traffic going out
over different devices) then we can get a clearer picture of what we
might need to change.

Note that there's also the 'Use this connection only for resources on
its network' checkbox in the connection editor (or never-default=true
for keyfile connections) that you can use to ensure that your preferred
connection gets the default route.

If you want to make sure that *by default* traffic goes out through
GPRS, you can set never-default=true for the wired and wifi connections,
and then wired + wifi dont' get the default route.  But you can still
route specific subnets over those devices by adding routes to the IPv4
Routes dialog in the connection editor.

So I think at the moment, a combination of never-default and specific
routes can get you most of where you want to go.  At least duplicate the
functionality that D-Bus controllable device type priorities would if
the priorities didn't need to be changed every 10 minutes.

> > 
> > > I want to make a proxy server who chose the connection according to
> > > the aviability of it or the kind of protocol witch is using.
> > > For exemple instant messaging don't need a big bandwidth but streaming
> > > yes so  instant messaging could be used though 56k modem or GPRS key
> > > instead of  using the ethernet connection.
> 
> This is similar to what we did. Applications could register with some service 
> and based on the applications the service would set the priorities inside NM.

Could you explain a bit more about the specific process here with some
examples of switching the priorities around between the device types?
Just trying to understand the use-case more.

Thanks!
Dan

> Markus
> 
> > This is somewhat complicated, because it's not about which connections
> > are active and which aren't, but it's about IP routing which
> > NetworkManager doesn't really get into (other than setting the default
> > route).
> > 
> > You can *simulate* this by adding specific routes to the servers you
> > want to use to the routing table.  So if you know your IM server's IP
> > address you could:
> > 
> > ip route add <im server ip>/32 dev <gprs interface name>
> > 
> > If that IP address is stable, you can add it to the NetworkManager
> > connection infromation for your GPRS connetion in the connection
> > editor's IPv4 Routes dialog and all your IM should then go over GPRS.
> > You can do that with NM today.
> > 
> > You can't use the kernels IP routing table for *classes* of traffic
> > right now, but you might be able to use the Linux firewall (iptables) to
> > do this for you since it's quite a flexible packet filter and does a lot
> > more than just firewalling.
> > 
> > So the short answer is:
> > 
> > - yes, you can make traffic to specific IP address or subnets use a
> > specific interface by adding those subnets as routes to the NM IPv4
> > Routes dialog
> > 
> > - it's a lot more complicated to send classes of traffic (ie, all web
> > traffic) out over a specific interface
> > 
> > Dan
> > 
> > > I already see documentation about QoS software like wondershaper but
> > > it is made for one connection.
> > > I hope my message is clear and i apologize for my poor English.
> > > 
> > > Best regards
> > > 
> > > PM
> > > _______________________________________________
> > > networkmanager-list mailing list
> > > networkmanager-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/networkmanager-list
> > 
> > _______________________________________________
> > networkmanager-list mailing list
> > networkmanager-list gnome org
> > http://mail.gnome.org/mailman/listinfo/networkmanager-list
> ------------------------------------------------
> | Dipl.-Ing. Markus Becker
> | Communication Networks
> | Mobile Research Center
> | TZI - Center for Computing Technologies
> | University Bremen
> | Germany
> ------------------------------------------------
> | web: http://www.comnets.uni-bremen.de/~mab/
> | mailto: mab comnets uni-bremen de
> | telephone: +49 421 218 62379
> | building: NW1 room: N2260
> ------------------------------------------------
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]