Creating L2TP VPN on Mac OS X Programatically
Asked Answered
D

1

6

I am trying to make application which can be use to connect to VPN using L2TP Protocol for Mac OSX Application using Objective C.

I search a lot regarding this but couldn't find any proper example or tutorial.

I Found halo/macosvpn for mac os vpn connection but it is command line tool i would like to make it in my application.

For E.g If i pass Server id, Shared Secret Key, username, password then my mac should be automatically connect to that VPN Server.

Any help will be appreciated...

Dunsany answered 2/3, 2015 at 11:34 Comment(4)
Sir have you got the solution?Velvety
Does macosvpn not provide the example you need? It is written in Objective-C and does specifically handle the L2TP protocol.Northnortheast
This is solved.. thanks for the replyDunsany
@MalavSoni Could you share your solution?Nannana
R
0

No, you need use SCNetwork and Helper Tool (to get root access) With this link you will be able to create L2TP Protocol and connect with it.

This works even on the latest version MacOS 11 "Big Sure"

The helper tool is needed to get root access so you can make changes to the system keychain. You will put the password and shared secret there, because the configuration will not be able to perceive them from other places. Having created a vpn configuration with the help of SCNetwork, the mac will not be able to automatically connect.

To connect to the created profile, you need to programmatically execute the terminal command

networksetup -connectpppoeservice "name VPN profile"
Recurvate answered 5/2, 2021 at 12:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.