janjust wroteit sounds like you're using a bridged setup with an external DHCP server ; in that case OpenVPN does not know the gateway, as it is provided by the DHCP server itself. The DHCPREQ & DCHPACK are processed outside of OpenVPN and hence no env var is known. You'd need to extract this information from the DHCP code, not from OpenVPN.
Yes, I'm using a bridged setup with an external DHCP server. I know that OpenVPN doesn't know the gateway. I'm not expecting $route_vpn_gateway in the up script to contain the gateway (the UP script, after all, is the process configuring the gateway via `ipconfig set tap0 DHCP`). What I expect is for $route_vpn_gateway to be equal to the value of the "route-gateway" setting in OpenVPN. OpenVPN always knows the value of route-gateway. It's either an IP address or (in my case) the literal text value of it is set to "dhcp." You can see that in this OpenVPN-logged output below (before the UP script is called):
2011-05-01 18:36:11 PUSH: Received control message: 'PUSH_REPLY,dhcp-option DNS 172.16.122.1,route 192.168.122.0 255.255.255.0 172.16.122.1,dhcp-option DOMAIN nickhq.com,route-gateway dhcp,ping 10,ping-restart 60'
As you can see by the presence of "route-gateway dhcp" in the log output, OpenVPN doesn't know the gateway address, but it DOES know that "route-gateway dhcp" was pushed to the client. Additionally, if I specify "route-gateway dhcp" in the client config file, OpenVPN knows that, too. It seems to me that, in this case, $route_vpn_gateway should literally be set to the string "dhcp" (as opposed to being unset, which is currently the case, or set to an IP address, which isn't possible). If nothing else, there should be some other environmental variable (such as a $foreign_option_{n} variable or $route_gateway_is_dhcp="true") that indicates that the "route-gateway dhcp" option was present or pushed.
So what I'm asking is, is there some other way for me to see within the script that "route-gateway dhcp" was present or pushed, or do I need to file a bug?
Thanks