howto iroute to be added dynamically using client-connet

All comments and questions related to the functionality of the OpenVPN web pages and forum should go here.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
tushar.sharma
OpenVPN Power User
Posts: 58
Joined: Fri Oct 07, 2011 12:23 pm
Location: Pune
Contact:

howto iroute to be added dynamically using client-connet

Post by tushar.sharma » Tue Jan 31, 2012 12:07 pm

Hello all,

I want to create a file in ccd/common-name of connecting client dynamically.
i wrote one script but it is not working , i don't it is right or wrong so please help
me to add iroute to ccd/common-name using client-connect script.

ThankingYou
Tushar

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: howto iroute to be added dynamically using client-connet

Post by maikcat » Tue Jan 31, 2012 2:54 pm

in ccd directory you create text files named after the certificates

ccd files are not scripts,they contain openvpn directives (like iroute)

you can also use ifconfig-push directive to force a specific ip to your
client so you can easily troubleshoot if you created ccd files correctly..

Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

tushar.sharma
OpenVPN Power User
Posts: 58
Joined: Fri Oct 07, 2011 12:23 pm
Location: Pune
Contact:

Re: howto iroute to be added dynamically using client-connec

Post by tushar.sharma » Wed Feb 01, 2012 6:57 am

Thanks for reply,

There are two ways as listed in manual either through ccd or --client-connect
I want to add iroute to openvpn dynamically whenever client connects ..
files in ccd/ cannot be created on fly so --client-connect is only option but
howto add iroute dynamically using --client-connect script.

Thanking You,
Tushar Sharma

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: howto iroute to be added dynamically using client-connet

Post by maikcat » Wed Feb 01, 2012 7:52 am

i believe your problem is with route statement not iroute inside ccd files...

dont forget that you must use BOTH route command inside server config and
iroute inside ccd client file.

Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

tushar.sharma
OpenVPN Power User
Posts: 58
Joined: Fri Oct 07, 2011 12:23 pm
Location: Pune
Contact:

Re: howto iroute to be added dynamically using client-connet

Post by tushar.sharma » Thu Feb 02, 2012 12:12 pm

Dear Michael,

Nopes Problem is not with route statement. I execute that outside of openvpn.

Let me explain it with actual scenario.

I have one openvpn server running that allows 10 client. I don't know common name of connecting
client in advance, so i cannot create files in ccd/ folder before hand.

Now i want that whenever client connects iroute command that we write in ccd/common_name_file should be addedd dynamically. As as far i understood from manual --client-connect targets this problem but i don't know how.

Thanking You
Tushar

Post Reply