Adding a static route to VPN-Server in ESP32/Arduino Sketch

I use an ESP32 with a web server in my network. I can setup Wifi and IP adress without problems, but my ESP32 is not reachable by my VPN connection. The reason is, that I use a dedicated VPN server which is not located on my gateway/router to the internet. When I connect to my network using VPN I need to add a new static route on my servers I want to access. On linux I use:

route add -net 10.5.5.0 netmask 255.255.255.0 gateway 192.168.0.14

To add a route to my VPN server.

How can I add a static route in my ESP32 sketch?

1 Like

Add that route on your main router. This is how a network is usually configured. Adding static routes on every device is a very unprofessional way.

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