I am following the steps of the guide [https://openwrt.org/docs/guide-user/services/vpn/openvpn/basic#prerequisites] to set up my vpn, and everything works ok until it came to the point of replacing Tun with Tap.
When I do these steps
Replacing TUN with TAP:
uci delete network.vpnserver
uci set network.lan.type="bridge"
uci set network.lan.ifname="wlan0 tap0"
uci commit network
service network restart
uci delete openvpn.vpnserver.server
uci set openvpn.vpnserver.dev="tap0"
uci set openvpn.vpnserver.server_bridge="192.168.1.1 255.255.255.0 192.168.1.220 192.168.1.229"
uci commit openvpn
service openvpn restart
sed -i -e "s/dev tun/dev tap/"
When I reach the fourth step, to reset the network, my openwrt loses the connection and I can not access it again in any way. I think it's because I'm deleting the interface since I do it, and that's why it's inaccessible.
I'm using the router as a switch, so I only have one lan interface, which includes all 4 ports. my idea is to create the openvpn server to connect from any place with my phone as if it were inside the lan network and thus be able to access the nas server, and other host of my network.
Can you please tell me what I'm doing wrong, or if those steps up there are good? I think it erases interfaces all the time but I do not know when it creates them