Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Sameer Naik
Thanks for your responses.
Really appreciate it.

Regards
~Sameer


On Mon, Feb 25, 2013 at 7:38 PM, Daniel Wagner  wrote:

> On 25.02.2013 14:59, Patrik Flykt wrote:
>
>> On Mon, 2013-02-25 at 14:29 +0100, Marcel Holtmann wrote:
>>
>>> I am getting the feeling that we might really need to start setting
>>> all
>>> gateways all the time, but have different metrics attached to them.
>>>
>>
>> That we probably could do, provided it'd work to some degree of "as
>> expected".
>>
>>  One case that bugs me a little bit is the fact if we have a 3G
>>> connection and want to switch to WiFi, but that needs to external page
>>> outside the IP range of the hotspot. A dedicated application or
>>> browser
>>> for logging into that hotspot should be able to use that gateway from
>>> that network interface if it chooses to.
>>>
>>> How this can be done best and if routing metrics would actually work,
>>> I
>>> do not know for sure actually. Something we might need to try.
>>>
>>
>> IIRC the routing metrics are there just to order between the default
>> routes. I can't remember which way binding to an interface was biased,
>> did it anyway follow the first route out or did it obey the default
>> route for the interface in question. A quick test should expose it's
>> inner workings.
>>
>> Wagi/Jukka were seen to be working on multiple routing table support for
>> sessions a longer time ago.
>>
>
> FWIW, I have a patches which allow per app routing now. I am working on
> some more iptables fixes and then I can resend them.
>
> cheers,
> daniel
>
> __**_
> connman mailing list
> connman@connman.net
> http://lists.connman.net/**listinfo/connman
>
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Daniel Wagner

On 25.02.2013 14:59, Patrik Flykt wrote:

On Mon, 2013-02-25 at 14:29 +0100, Marcel Holtmann wrote:

I am getting the feeling that we might really need to start setting
all
gateways all the time, but have different metrics attached to them.


That we probably could do, provided it'd work to some degree of "as
expected".


One case that bugs me a little bit is the fact if we have a 3G
connection and want to switch to WiFi, but that needs to external page
outside the IP range of the hotspot. A dedicated application or
browser
for logging into that hotspot should be able to use that gateway from
that network interface if it chooses to.

How this can be done best and if routing metrics would actually work,
I
do not know for sure actually. Something we might need to try.


IIRC the routing metrics are there just to order between the default
routes. I can't remember which way binding to an interface was biased,
did it anyway follow the first route out or did it obey the default
route for the interface in question. A quick test should expose it's
inner workings.

Wagi/Jukka were seen to be working on multiple routing table support for
sessions a longer time ago.


FWIW, I have a patches which allow per app routing now. I am working on 
some more iptables fixes and then I can resend them.


cheers,
daniel
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Patrik Flykt
On Mon, 2013-02-25 at 14:29 +0100, Marcel Holtmann wrote:
> I am getting the feeling that we might really need to start setting
> all
> gateways all the time, but have different metrics attached to them.

That we probably could do, provided it'd work to some degree of "as
expected".

> One case that bugs me a little bit is the fact if we have a 3G
> connection and want to switch to WiFi, but that needs to external page
> outside the IP range of the hotspot. A dedicated application or
> browser
> for logging into that hotspot should be able to use that gateway from
> that network interface if it chooses to.
> 
> How this can be done best and if routing metrics would actually work,
> I
> do not know for sure actually. Something we might need to try.

IIRC the routing metrics are there just to order between the default
routes. I can't remember which way binding to an interface was biased,
did it anyway follow the first route out or did it obey the default
route for the interface in question. A quick test should expose it's
inner workings.

Wagi/Jukka were seen to be working on multiple routing table support for
sessions a longer time ago.


Cheers,

Patrik

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Sameer Naik
On Mon, Feb 25, 2013 at 7:17 PM, Patrik Flykt
wrote:

> On Mon, 2013-02-25 at 18:24 +0530, Sameer Naik wrote:
> > 192.168.1.1 * 255.255.255.255 UH0  00 eth0
> > 192.168.6.1 * 255.255.255.255 UH0  00 wlan0
>
> These are individual host routes to the DNS servers. In normal
> circumstances the DNS server is co-located to the DHCP server box, at
> least with normal home networking.
>
> > By looking up the service that is currently in the online state, i
> > would be
> > able to tell which is the default route (provided that only one
> > service is
> > in the online at any given time,
>
> The first service in the service list is the one with the default route
> and also the only one which can be online. Otherwise...
>
> >  which right now is not always the case).
>
> ...you have found a bug, I believe.
>
> I may be wrong about this... i will need to recheck.

>
> Cheers,
>
> Patrik
>
> ___
> connman mailing list
> connman@connman.net
> http://lists.connman.net/listinfo/connman
>
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Patrik Flykt
On Mon, 2013-02-25 at 18:24 +0530, Sameer Naik wrote:
> 192.168.1.1 * 255.255.255.255 UH0  00 eth0
> 192.168.6.1 * 255.255.255.255 UH0  00 wlan0

These are individual host routes to the DNS servers. In normal
circumstances the DNS server is co-located to the DHCP server box, at
least with normal home networking.

> By looking up the service that is currently in the online state, i
> would be
> able to tell which is the default route (provided that only one
> service is
> in the online at any given time,

The first service in the service list is the one with the default route
and also the only one which can be online. Otherwise...

>  which right now is not always the case). 

...you have found a bug, I believe.


Cheers,

Patrik

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Marcel Holtmann
Hi Patrik,

> > I found that when i connect both the wired and wifi technologies (i.e.
> > connect to a service for each), only one of them goes in the online
> > state.
> > Both will be never enter the online state under normal circumstances.
> > 
> > eg.
> > 1. Start connman with lan cable connected
> >   Connman connects to the lan network and enter the online state
> > 2. Connect to a wireless service
> >   Connman connects to the wireless service, and the service
> > remains in
> > the offline state until the ethernet cable is disconnected.
> > 
> > This is probably a behaviour by design and i can understand why it is
> > this
> > way. One of the reason being that only one interface can
> > serve as the default route at a time, etc.
> 
> Your observation is correct, only one default route is set at a time. As
> a default route is defined as matching every packet and sending the
> packets to the gateway, only one gateway is set at any time. So only the
> service which has the default route will contain gateway information.
> Thus the network information provided by all services is identical to
> what can be read from the routing table.

I am getting the feeling that we might really need to start setting all
gateways all the time, but have different metrics attached to them.

One case that bugs me a little bit is the fact if we have a 3G
connection and want to switch to WiFi, but that needs to external page
outside the IP range of the hotspot. A dedicated application or browser
for logging into that hotspot should be able to use that gateway from
that network interface if it chooses to.

How this can be done best and if routing metrics would actually work, I
do not know for sure actually. Something we might need to try.

Exposing the Gateway entry if it is not set is actually of little
benefit besides for a debug UI. We should keep to our general semantic
that details in IPv4, IPv6 etc. dictionaries represent the actual
current system settings for that service.

Regards

Marcel


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Sameer Naik
Hello Patrik,

But shouldn't the gateway returned for each service be the route setup for
the interface on which the service is running (at least display purposes)

ie.
192.168.1.1 *   255.255.255.255 UH0  00 eth0
192.168.6.1 *   255.255.255.255 UH0  00
wlan0

By looking up the service that is currently in the online state, i would be
able to tell which is the default route (provided that only one service is
in the online at any given time, which right now is not always the case).

Of course, i should be able to get the gateway information using socket
api's or something for my display purposes. But i believe connman would do
a better job at it ;)

Regards
~Sameer



On Mon, Feb 25, 2013 at 6:03 PM, Patrik Flykt
wrote:

>
> Hi,
>
> On Mon, 2013-02-25 at 17:32 +0530, Sameer Naik wrote:
> > I found that when i connect both the wired and wifi technologies (i.e.
> > connect to a service for each), only one of them goes in the online
> > state.
> > Both will be never enter the online state under normal circumstances.
> >
> > eg.
> > 1. Start connman with lan cable connected
> >   Connman connects to the lan network and enter the online state
> > 2. Connect to a wireless service
> >   Connman connects to the wireless service, and the service
> > remains in
> > the offline state until the ethernet cable is disconnected.
> >
> > This is probably a behaviour by design and i can understand why it is
> > this
> > way. One of the reason being that only one interface can
> > serve as the default route at a time, etc.
>
> Your observation is correct, only one default route is set at a time. As
> a default route is defined as matching every packet and sending the
> packets to the gateway, only one gateway is set at any time. So only the
> service which has the default route will contain gateway information.
> Thus the network information provided by all services is identical to
> what can be read from the routing table.
>
> Cheers,
>
> Patrik
>
> ___
> connman mailing list
> connman@connman.net
> http://lists.connman.net/listinfo/connman
>
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Patrik Flykt

Hi,

On Mon, 2013-02-25 at 17:32 +0530, Sameer Naik wrote:
> I found that when i connect both the wired and wifi technologies (i.e.
> connect to a service for each), only one of them goes in the online
> state.
> Both will be never enter the online state under normal circumstances.
> 
> eg.
> 1. Start connman with lan cable connected
>   Connman connects to the lan network and enter the online state
> 2. Connect to a wireless service
>   Connman connects to the wireless service, and the service
> remains in
> the offline state until the ethernet cable is disconnected.
> 
> This is probably a behaviour by design and i can understand why it is
> this
> way. One of the reason being that only one interface can
> serve as the default route at a time, etc.

Your observation is correct, only one default route is set at a time. As
a default route is defined as matching every packet and sending the
packets to the gateway, only one gateway is set at any time. So only the
service which has the default route will contain gateway information.
Thus the network information provided by all services is identical to
what can be read from the routing table.

Cheers,

Patrik

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Sameer Naik
I forgot to mention one thing, i have
PreferredTechnologies = ethernet
in my main.conf.


On Mon, Feb 25, 2013 at 5:32 PM, Sameer Naik <
sameer.subscripti...@damagehead.com> wrote:

> Hello,
>
> I am using connman-1.11 on an STB platform that has an inbuilt LAN port.
> For WIFI i am using a wifi dongle.
>  So far i have got every thing working fine. I am able to connect to wired
> and wireless networks. I am currently testing the stuff out and
> understanding some connman behaviour patterns along the way.
>
> I found that when i connect both the wired and wifi technologies (i.e.
> connect to a service for each), only one of them goes in the online state.
> Both will be never enter the online state under normal circumstances.
>
> eg.
> 1. Start connman with lan cable connected
>   Connman connects to the lan network and enter the online state
> 2. Connect to a wireless service
>   Connman connects to the wireless service, and the service remains in
> the offline state until the ethernet cable is disconnected.
>
> This is probably a behaviour by design and i can understand why it is this
> way. One of the reason being that only one interface can
> serve as the default route at a time, etc.
>
> But what i noticed is that, if i get the ipv4 configuration for each of
> the technologies, only the service that is on currently serving as the
> default route return the gateway.
> To make my point clearer, please refer to the output of GetServices method
> at http://pastebin.com/DVkXJiNB. You will notice that of the 2 connected
> services, only the wired service returns the gateway address.
>
> Is this by design? Is possible to get the gateway for services that are in
> READY state??
>
> Thanks and Regards
> ~Sameer
>
>
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Unable to get the gateway of a service that is not the default route.

2013-02-25 Thread Sameer Naik
Hello,

I am using connman-1.11 on an STB platform that has an inbuilt LAN port.
For WIFI i am using a wifi dongle.
So far i have got every thing working fine. I am able to connect to wired
and wireless networks. I am currently testing the stuff out and
understanding some connman behaviour patterns along the way.

I found that when i connect both the wired and wifi technologies (i.e.
connect to a service for each), only one of them goes in the online state.
Both will be never enter the online state under normal circumstances.

eg.
1. Start connman with lan cable connected
  Connman connects to the lan network and enter the online state
2. Connect to a wireless service
  Connman connects to the wireless service, and the service remains in
the offline state until the ethernet cable is disconnected.

This is probably a behaviour by design and i can understand why it is this
way. One of the reason being that only one interface can
serve as the default route at a time, etc.

But what i noticed is that, if i get the ipv4 configuration for each of the
technologies, only the service that is on currently serving as the default
route return the gateway.
To make my point clearer, please refer to the output of GetServices method
at http://pastebin.com/DVkXJiNB. You will notice that of the 2 connected
services, only the wired service returns the gateway address.

Is this by design? Is possible to get the gateway for services that are in
READY state??

Thanks and Regards
~Sameer
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman