# Default route not working

**URL:** <https://forum.legato.io/t/default-route-not-working/2941>\
**Category:** Legato Application Framework\
**Created:** [January 9, 2018, 12:21am UTC](https://forum.legato.io/t/default-route-not-working/2941 "2018-01-09T00:21:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [January 9, 2018, 12:21am UTC](https://forum.legato.io/t/default-route-not-working/2941/1 "2018-01-09T00:21:47Z")

</div>

According to the Legato docs, if you make a connection with the defaultRouteStatus true, (which is startup default), then the default route will be automatically made. This is not the case. If I try to ping an address after the connection, there is no default route:

route  
Kernel IP routing table  
Destination Gateway Genmask Flags Metric Ref Use Iface  
100.118.20.80 \* 255.255.255.248 U 0 0 0 rmnet\_data0  
192.168.2.0 \* 255.255.255.0 U 0 0 0 ecm0  
192.168.225.0 \* 255.255.255.0 U 0 0 0 bridge0

The docs says that if it’s false, then you have to set the route yourself which requires access. If it would set that automatically, it would allow my component to run sandboxed. Do we have a work around for this?

---

<div class="post-metadata">

**Author:** ![lotam](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lotam](https://forum.legato.io/u/lotam)\
**Post date:** [January 9, 2018, 1:01am UTC](https://forum.legato.io/t/default-route-not-working/2941/2 "2018-01-09T01:01:35Z")

</div>

May I ask below info?

- Product and Legato version
- How do you establish the data connection? which API you are using?

Thx

---

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [January 9, 2018, 3:03pm UTC](https://forum.legato.io/t/default-route-not-working/2941/3 "2018-01-09T15:03:13Z")

</div>

Product is WP7601. Legato version is 17.9.0. Windows 10, Dev Studio 5.3.

I establish the data connection using the modemServices by setting the index to 3 (Verizon), verifying the proper APN and calling le\_mdc\_StartSession(profile), as per the documentation.

I make the connection with no issue. But it doesn’t have a default route. In the Docs, it says it will.

Making the connection with the connection manager does the same thing. No default route.

---

<div class="post-metadata">

**Author:** ![lotam](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lotam](https://forum.legato.io/u/lotam)\
**Post date:** [January 10, 2018, 11:33am UTC](https://forum.legato.io/t/default-route-not-working/2941/4 "2018-01-10T11:33:49Z")

</div>

There are 2 set of APIs to setup data connection.

- le\_data\_
- le\_mdc\_

Believe you are referring to this link for useDefaultRoute

> **[le\_data Interface - Legato Docs](http://docs.legato.io/latest/c_le_data.html)**
>
> legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

But it applies to le\_data\_Request() only.

As you are using le\_mdc\_StartSession(profile), you have to setup the default route in your app.  
Otherwise, you may consider using le\_data\_Request().

Hope it helps.

---

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [January 12, 2018, 2:26pm UTC](https://forum.legato.io/t/default-route-not-working/2941/5 "2018-01-12T14:26:35Z")

</div>

OK. Since this requires that the app be un-sandboxed to run the “route” command, is there some way in a sandboxed app to be able to do these things?

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [January 12, 2018, 8:46pm UTC](https://forum.legato.io/t/default-route-not-working/2941/6 "2018-01-12T20:46:53Z")

</div>

Hi @EvetsMostel,

Basically `le_mdc` is quite low-level and relies on you to take care of the routing. It just gives you an end-point without managing much more, which gives you some freedom over what you want to do.

`le_data` is there to cover the most common use cases where a system wants connectivity to the internet from time to time, and can request such connection from the DCS (= `DataConnectionService`), that eventually relies on `le_mdc` to create such connection and make it available (= routing) to the user.

So if you do not want to manage routing, I would suggest that you look into `le_data`.
