I have been running an OpenVPN-server for some time now, on Linux. I want to move this to a new FreeBSD-server. I have always used a bridged setup for OpenVPN, where the OpenVPN tap-interface and the physical network-interface are joined together in a bridge. The bridge is given all the proper network configuration, like an IP-address.
I have OpenVPN up and running and I have worked out how to put it in a bridged setup. however, when I reboot the server, everything is a mess! I patched together a small script that I have to run after the reboot, to make it all work. This is obviously not how I want to implement this.
Does someone know how I can configure FreeBSD to make this all work properly?
/etc/rc.conf
Small script, to make it work again
I have OpenVPN up and running and I have worked out how to put it in a bridged setup. however, when I reboot the server, everything is a mess! I patched together a small script that I have to run after the reboot, to make it all work. This is obviously not how I want to implement this.
Does someone know how I can configure FreeBSD to make this all work properly?
/etc/rc.conf
Code:
hostname="openvpn.somedomain.com"
openvpn_enable="YES"
openvpn_if="tap"
cloned_interfaces="bridge0"
ifconfig_bridge0="addm msk0 addm tap0 up"
ifconfig_msk0="up"
ifconfig_tap0="up"
ifconfig_bridge0=" inet xxx.xxx.xxx.xxx netmask 255.255.255.0"
defaultrouter="xxx.xxx.xxx.xxx"
sshd_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
Small script, to make it work again
Code:
ifconfig bridge0 addm msk0 addm tap0 up
ifconfig msk0 up
ifconfig tap0 up
ifconfig bridge0 inet 192.168.1.70 netmask 255.255.255.0
route add default 192.168.1.1