--up script with network

Scripts with setup, destroy, and modify routing tables and firewall rulesets for client connections.

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

Post Reply
balboah
OpenVpn Newbie
Posts: 1
Joined: Sun Dec 06, 2009 5:16 pm

--up script with network

Post by balboah » Sun Dec 06, 2009 5:18 pm

I'm trying to create a script that should connect to a server within the vpn network when the connection is established,
where can I hook this up? Doesn't seem to be able to connect in the --up state.

User avatar
krzee
Forum Team
Posts: 728
Joined: Fri Aug 29, 2008 5:42 pm

Re: --up script with network

Post by krzee » Mon Dec 07, 2009 1:29 pm

SCRIPTING AND ENVIRONMENTAL VARIABLES

OpenVPN exports a series of environmental variables for use by user-defined scripts.
Script Order of Execution

--up
Executed after TCP/UDP socket bind and TUN/TAP open.
--tls-verify
Executed when we have a still untrusted remote peer.
--ipchange
Executed after connection authentication, or remote IP address change.
--client-connect
Executed in --mode server mode immediately after client authentication.
--route-up
Executed after connection authentication, either immediately after, or some number of seconds after as defined by the --route-delay option.
--client-disconnect
Executed in --mode server mode on client instance shutdown.
--down
Executed after TCP/UDP and TUN/TAP close.
--learn-address
Executed in --mode server mode whenever an IPv4 address/route or MAC address is added to OpenVPN's internal routing table.
--auth-user-pass-verify
Executed in --mode server mode on new client connections, when the client is still untrusted.


check those in the manual to see which may work for you

Post Reply