Connect to openwrt but lose internet on pc

Hello guys, i have openwrt setup in virtualbox. I used exactly this tutorial to make it:

Then i made openVPN server, using this guide:

i just changed
. /lib/functions/network.sh
network_flush_cache
network_find_wan NET_IF
network_get_ipaddr NET_ADDR "${NET_IF}"
OVPN_SERV="${NET_ADDR}"

NET ADDR = 192.168.56.2 (because thats the remote address yes?)

And when i connect with client to openVPN server i lose connection to router and i lose internet on my PC until I disconnect. Any ideas?

All configurations where used from these tutorials

Provide a diagram with your real and virtual network topology.
Explain in detail what you want to achieve and how you expect it to work.

(post deleted by author)

You most likely should not use this interface for VPN.
Typically, you need to use bridged networking to reach the guest from outside:
https://www.virtualbox.org/manual/ch06.html#network_bridged

It automatically detects your upstream link.

How do you expect to reach this address from outside the host?
Assuming the server is running in a VM, but where is your client?

Connecting to the VPN server with enabled redirect-gateway changes the default route on the client.
When providing virtual networking with NAT, the guest's upstream is routed over the host.
This can result in a deadlock when the VPN server runs on a VM hosted by the VPN client.
You can use the virtual networking method that does not depend on the host's default route.
Otherwise, set up another VM to serve the VPN client role, or disable redirect-gateway.

You cannot hide IP if both VPN client and server are behind the same ISP/router.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.