# Iocage VNET and OpenVPN



## zader (Nov 25, 2019)

Just wondering if anyone has got VNET's and iocage to play with openvpn?

Seems every scrap of info I have found is for a tun device or for freenas

Thanks


----------



## SirDice (Nov 25, 2019)

OpenVPN will always create a tun(4) or tap(4) virtual interface, that's how it works.


----------



## zader (Nov 25, 2019)

thanks for the comment.. 

I guess posting my error may help ..  I am never able to get or establish a tun0 device... all I get is 254 errors like this

```
Mon Nov 25 12:16:43 2019 us=812539 Tried opening /dev/tun0 (failed): No such file or directory (errno=2)
Mon Nov 25 12:16:43 2019 us=812578 Tried opening /dev/tun1 (failed): No such file or directory (errno=2)
Mon Nov 25 12:16:43 2019 us=812610 Tried opening /dev/tun2 (failed): No such file or directory (errno=2)
....cut
Mon Nov 25 12:16:43 2019 us=822732 Tried opening /dev/tun254 (failed): No such file or directory (errno=2)
Mon Nov 25 12:16:43 2019 us=822778 Tried opening /dev/tun255 (failed): No such file or directory (errno=2)
Mon Nov 25 12:16:43 2019 us=822800 Cannot allocate TUN/TAP dev dynamically
Mon Nov 25 12:16:43 2019 us=822829 Exiting due to fatal error
```


```
# ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet 127.0.0.1 netmask 0xff000000
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8<VLAN_MTU>
    ether xxx.xxx.xxx.xxx
    hwaddr xxx.xxx.xxx.xxx
    inet xxx.xxx.xxx.xxx netmask 0xff000000 broadcast xxx.xxx.xxx.xxx
    groups: epair
    media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
tun256: flags=8010<POINTOPOINT,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    groups: tun
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```

on the host I have ..

A bridge0 with each member getting a vnetXX

Networking from within the jail itself works fine.

Just wondering if this is expected? Or should be working etc?   

Or should I just get rid of iocage and do it "normally" ?
Thanks


----------

