Hello everybody,
I've been trying to set up openvpn inside a jail using a bridged configuration (tap interface), but my config fails. The directions I've been using are for tun interfaces from this thread, and I thought that I would make them work by making a few modifications, but I was wrong.
Here's my output when I run openvpn /usr/local/etc/openvpn/server.conf as root:
And here's what I've done so far:
excerpt from /etc/rc.conf on jail 0:
Inside my openvpn jail, the /usr/local/etc/openvpn/server.conf reads:
Moreover, I've changed my /etc/devfs.rules on jail 0 to allow access from inside the openvpn jail, so inside my openvpn-jail I have:
and finally, inside my openvpn-jail my interfaces read:
I've tried to start openvpn without reduced privileges, with no luck.
I haven't set up any bridge configuration, yet, since I am unable to even start my service. I've looked at this thread where ghostcorps has finally achieved a similar configuration to mine, but the problems he's facing are not the same as mine.
Anyone any suggestions?
Thanks in advance!
I've been trying to set up openvpn inside a jail using a bridged configuration (tap interface), but my config fails. The directions I've been using are for tun interfaces from this thread, and I thought that I would make them work by making a few modifications, but I was wrong.
Here's my output when I run openvpn /usr/local/etc/openvpn/server.conf as root:
Code:
Thu May 31 07:32:37 2012 OpenVPN 2.2.2 amd64-portbld-freebsd9.0 [SSL] [LZO2] [eurephia] built on May 30 2012
Thu May 31 07:32:37 2012 NOTE: when bridging your LAN adapter with the TAP adapter, note that the new bridge adapter
will often take on its own IP address that is different from what the LAN adapter was previously set to
openvpn: writing to routing socket: No such process
Thu May 31 07:32:37 2012 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts
or executables
Thu May 31 07:32:37 2012 Note: cannot open ipp.txt for READ/WRITE
Thu May 31 07:32:37 2012 Diffie-Hellman initialized with 2048 bit key
Thu May 31 07:32:37 2012 WARNING: file '/usr/local/etc/openvpn/keys/server.key' is group or others accessible
Thu May 31 07:32:37 2012 TLS-Auth MTU parms [ L:1590 D:138 EF:38 EB:0 ET:0 EL:0 ]
Thu May 31 07:32:37 2012 Socket Buffers: R=[42080->65536] S=[9216->65536]
Thu May 31 07:32:37 2012 Cannot allocate TUN/TAP dev dynamically
Thu May 31 07:32:37 2012 Exiting
And here's what I've done so far:
excerpt from /etc/rc.conf on jail 0:
Code:
cloned_interfaces="tap0 tap1 tap2"
jail_enable="YES"
jail_set_hostname_allow="NO"
jail_list="apache openvpn"
jail_openvpn_hostname="openvpn.lala"
jail_openvpn_rootdir="/jails/j/openvpn"
jail_openvpn_devfs_enable="YES"
jail_openvpn_ip="192.168.13.3/24"
jail_openvpn_ip_multi0="tap2|10.8.0.1 mtu 1500 netmask 255.255.255.0"
jail_openvpn_interface="tap1"
Inside my openvpn jail, the /usr/local/etc/openvpn/server.conf reads:
Code:
port 1194
proto udp
dev tap
ca /usr/local/etc/openvpn/keys/ca.crt
cert /usr/local/etc/openvpn/keys/server.crt
key /usr/local/etc/openvpn/keys/server.key # This file should be kept secret
dh /usr/local/etc/openvpn/keys/dh2048.pem
ifconfig-pool-persist ipp.txt
server-bridge 10.8.0.1 255.255.255.0 10.8.0.100 10.8.0.200
push "route 192.168.100.0 255.255.255.0"
keepalive 10 120
cipher AES-256-CBC # AES
comp-lzo
user openvpn
group openvpn
persist-key
persist-tun
status /var/log/openvpn-status.log
log /var/log/openvpn.log
log-append /var/log/openvpn.log
verb 3
ifconfig-noexec
Moreover, I've changed my /etc/devfs.rules on jail 0 to allow access from inside the openvpn jail, so inside my openvpn-jail I have:
Code:
[root@openvpn-jail /]# ls -rlta /dev/tap*
crw------- 1 root wheel - 0, 89 23 Μαϊ 11:48 /dev/tap0
crw------- 1 root wheel - 0, 108 30 Μαϊ 14:20 /dev/tap1
crw------- 1 root wheel - 0, 109 30 Μαϊ 14:20 /dev/tap2
and finally, inside my openvpn-jail my interfaces read:
Code:
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:0c:29:a2:98:85
ifconfig: socket(AF_INET6, SOCK_DGRAM): Protocol not supported
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
ifconfig: socket(AF_INET6, SOCK_DGRAM): Protocol not supported
pflog0: flags=0<> metric 0 mtu 33152
ifconfig: socket(AF_INET6, SOCK_DGRAM): Protocol not supported
pfsync0: flags=0<> metric 0 mtu 1500
ifconfig: socket(AF_INET6, SOCK_DGRAM): Protocol not supported
syncpeer: 0.0.0.0 maxupd: 128
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
ifconfig: socket(AF_INET6, SOCK_DGRAM): Protocol not supported
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:bd:a4:04:00:00
ifconfig: socket(AF_INET6, SOCK_DGRAM): Protocol not supported
tap1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:bd:55:d4:a7:01
inet 192.168.13.3 netmask 0xffffff00 broadcast 192.168.13.255
ifconfig: socket(AF_INET6, SOCK_DGRAM): Protocol not supported
tap2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:bd:6b:d7:a7:02
inet 10.8.0.1 netmask 0xffffff00 broadcast 10.8.0.255
ifconfig: socket(AF_INET6, SOCK_DGRAM): Protocol not supported
I've tried to start openvpn without reduced privileges, with no luck.
I haven't set up any bridge configuration, yet, since I am unable to even start my service. I've looked at this thread where ghostcorps has finally achieved a similar configuration to mine, but the problems he's facing are not the same as mine.
Anyone any suggestions?
Thanks in advance!