OpenVPN Fails to Establish VPN Tunnel in Railway Container Due to Missing TUN/TAP Device
ashutosh-fiftyfive
PROOP

4 months ago

Summary:

We are attempting to establish an OpenVPN connection from an application deployed on Railway. Although the OpenVPN process starts successfully, it fails during tunnel creation because the required TUN/TAP device is not available within the container environment.

Business Impact:

The application requires VPN connectivity to access an internal Microsoft SQL Server database located on a private network . Since the VPN tunnel cannot be established, the application is unable to connect to the database and the associated functionality is unavailable.

Issue Details:

The application invokes OpenVPN using the following command:

openvpn --config <config_file> --auth-user-pass <auth_file> --daemon --connect-retry 2 --connect-retry-max 3

During execution, OpenVPN exits with the following error:

ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)

Exiting due to fatal error

Additional Diagnostic Information:

Network Interfaces:

ip addr

Output:

1: lo

2: tunl0@NONE (DOWN)

3: railnet0 (UP)

No tun0 interface is created after OpenVPN startup.

Routing Table:

ip route

Output:

default via 10.128.0.1 dev railnet0

10.128.0.0/9 via 10.128.0.1 dev railnet0

No VPN routes are present.

Solved$20 Bounty

Pinned Solution

Try using Tailscale (https://railway.com/deploy/uIBpGp) instead of OpenVPN.

1 Replies

Railway
BOT

4 months ago

This thread has been opened as a public bounty so the community can help solve it. The thread and any further activity are now visible to everyone.

Status changed to Open Railway • 4 months ago


Try using Tailscale (https://railway.com/deploy/uIBpGp) instead of OpenVPN.


Status changed to Solved 0x5b62656e5d • 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...