You're listed as the most recent editor of the OpenVPN wiki article, so I'm directing my question to you for the moment (obviously loop in other contributors, if any, as you see fit).
My question is about the following push statements in the server setup:
uci add_list openvpn.vpnserver.push='route-gateway dhcp' uci add_list openvpn.vpnserver.push='route 192.168.200.0 255.255.255.0' uci add_list openvpn.vpnserver.push='dhcp-option DNS 192.168.1.1'
In the "Installing and using OpenWRT" forum section, there have been a bunch of threads (some of which I have contributed to) where the users have had issues connecting to their local network and/or the internet via their VPN. The solution has often been to remove the first quoted line, and to adjust the other two lines to match their main LAN config as shown below (I changed only the pushed route, but both of these would be changed to another network if 192.168.1.0/24 was not the default).
uci add_list openvpn.vpnserver.push='route 192.168.1.0 255.255.255.0' uci add_list openvpn.vpnserver.push='dhcp-option DNS 192.168.1.1'
So my questions are as follows:
- Why does the wiki recommend pushing the route of the VPN server itself -- I think that this is not necessary since the VPN client will get an IP in the VPN server's network and will already understand that route. Further, from what I can tell, the push directive should provide the route that is not already known -- that is, to the main LAN/gateway address.
- Why does the wiki suggest pushing route-gateway dhcp? Based on my first question, it seems that just pushing the route to the LAN/gateway does the trick.
- Would it make sense to add a note to the wiki that states a key assumption -- that the main LAN is 192.168.1.0/24 and that it is assumed that the router and DNS services are on 192.168.1.1 (the typical default address of an OpenWRT router). If this is not the case (a non-default config) obviously the dhcp-option DNS (and the push route to the main LAN) would need to be modified to match the user's currently configured LAN and router address?
I'll fully admit that maybe there are some things about the OpenVPN configuration recommendations in the wiki that I am missing, but based on a number of threads (and the resolutions of those issues), I am wondering why the recommendations are they way they are. Maybe you can shed some light on what I'm missing and/or test to see if my solutions/suggestions are worthy of being included/updated in the Wiki (or maybe as troubleshooting/alternative methods of configuration).