[strongSwan] StrongSwan Cilent for Android ICS

Tobias Brunner tobias at strongswan.org
Mon Oct 29 09:18:52 CET 2012


Hi,

> We are trying to add routes on *tun0 *interface using addRoute() Api of
> CharonVpnService Builder Adapter (Using Java code).
> ...
> When we call addRoute api before establishing the tunnel the routes are
> getting added. But After establishing the tunnel the routes are not
> getting added.

You can't.  The VpnService.Builder class (or the adapter in
CharonVpnService) is just that, a builder.  Once the TUN device has been
created (by calling establish()) calls to any of the add... methods are
ignore (the adapter internally creates a new instance of the Builder
class so there the routes are stored for the next call to establish()).

> Could you please suggest us the way to add route on tun0 interface after
> the tunnel has established. 

You would have to store all the information added to the previous
Builder object and then create a new TUN device when you added your routes.

Regards,
Tobias





More information about the Users mailing list