1

My machine get's an IP from OpenVPN server when connecting to the VPN gateway. This is tun0 on Ubuntu. I assume naming might be different for other systems that may connect to OpenVPN gateway.

Is that a reliable way (a script) to determine an IP, that was given to a machine by VPN gateway?

Maxim V. Pavlov
  • 663
  • 3
  • 11
  • 29

1 Answers1

3

You probably want to specify an up script, which will receive the ifconfig_local and ifconfig_remote environment variables, which contain the local and remote IP addresses assigned to the VPN tunnel.

You'll also need to set script-security 2 in order to have your script actually run.

womble
  • 96,255
  • 29
  • 175
  • 230