I have set up OpenVPN on my home network as well as my parents' home network using two DDWRT-enabled Linksys WRT160N routers. I use it to bridge the two LAN's together and it works great. I decided that I wanted to be able to access the LAN from anywhere else, so I set up another OpenVPN server on my router to log in from anywhere:
[Laptop] <---Internet---> [Router OpenVPN Server] [Router OpenVPN Client] <---Internet---> [Parents' Router OpenVPN Server]
Both routers run DHCP (mine is 192.168.3.1, theirs 192.168.2.1, and netmask 255.255.0.0 so they can see each other). This part works fine, and when I'm away I can see both my home LAN and their LAN (I have a machine back at their house that I wanted to remote into and when I'm visiting I still have access to my LAN server at my house).
However, when I took my laptop back to my house and connected it to my router's WiFi, the laptop took two IP addresses (one on the router's DHCP, one on the OpenVPN server) and could not connect to the Internet. Disabling the OpenVPN connection fixes the problem.
Is there any way to configure OpenVPN so that it does not connect the tap device if it is already on the LAN? My laptop runs both Windows 7 and Ubuntu 12.04, though as of now I haven't set up OpenVPN on Windows.
remote <no-ip redirect to home network> 1194
client
dev tap0
proto udp
resolv-retry infinite
nobind
persist-key
persist-tun
float
ca ca.crt
cert client3.crt
key client3.key
ns-cert-type server