[SOLVED]. OpenVpn Tap crashed openwrt


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=""
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

Thank you

Probably there should be another interface name, such as eth0.1.


Yes. Also do not reference the WLANs in /etc/config/network, the option network setting in /etc/config/wireless will attach them to a network.

Use brctl show to see what is in your br-lan now. Then add the tap device to it, don't take any out.

I find it easier to see the big picture by opening and editing the config files rather than running uci commands.

1 Like

Yes, the problem was that it did not add eth0.1

Putting this works ok :

uci set network.lan.ifname="wlan0 tap0 eth0.1"

Thank you

If your problem is solved, feel free to mark the relevant post as the solution; and edit the title to add "[SOLVED]" to the beginning (click the pencil behind the topic).


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