OPNsense Forum

English Forums => Virtual private networks => Topic started by: mauzilla on March 25, 2022, 07:13:44 PM

Title: dev tun also requires ifconfig
Post by: mauzilla on March 25, 2022, 07:13:44 PM
I need to setup a VPN between a single device at office A to connect to 2 - 3 devices at site B. I using openVPN but unable to get a successful connection with log indicating:

2022-03-25 19:38:38 open_tun
2022-03-25 19:38:38 tap-windows6 device [OpenVPN TAP-Windows6] opened
2022-03-25 19:38:38 ERROR: --dev tun also requires --ifconfig
2022-03-25 19:38:38 Exiting due to fatal error


My local config looks like this:

dev tun
persist-tun
persist-key
cipher AES-128-CBC
auth SHA1
client
resolv-retry infinite
remote REMOTESITEIP 1194 udp
lport 0
remote-cert-tls server
pkcs12 Acme_DC_VPN_intellihost.p12
tls-auth Acme_DC_VPN_intellihost-tls.key 1


On the server side, I have the following:


From what I can gather, I need to specify in my config file what IP address the connecting device would get (I assume then in the 192.168.231.0/30 range like 192.168.231.2? I am able to connect fine using TUN, TAP however gives the above.



Title: Re: dev tun also requires ifconfig
Post by: franco on March 25, 2022, 07:54:05 PM
If you set server to tap why not set the client to tap as well?


Cheers,
Franco
Title: Re: dev tun also requires ifconfig
Post by: Patrick M. Hausen on March 25, 2022, 11:10:41 PM
If using tap the remote device is bridged into your local LAN so regularly the IP address is not provided by OpenVPN but by you local DHCP server. If you want to use a routed subnet - which I would recommend for reasons I don't have the time to explain en detail just now, please just take that bridged VPN has "issues", always - then you need to use tun instead of tap.

HTH,
Patrick