Install Vtun On FreeBSD
TUN/TAP provides packet reception and transmission for user space programs.
It can be viewed as a simple Point-to-Point or Ethernet device, which
instead of receiving packets from a physical media, receives them from
user space program and instead of sending packets via physical media
writes them to the user space program.
When a program opens /dev/tunX or /dev/tapX, driver creates and
registers corresponding net device tunX or tapX. After a program closed
above devices, driver will automatically delete tunXX or tapXX device
and all routes corresponding to it.
Install
cd /usr/ports/net/vtun
make install
config /usr/local/etc/vtun.conf
examples :
freebsd {
passwd freebsd;
type ether;
device tap1;
proto tcp;
compress lzo:9;
encrypt yes;
up {
ifconfig “%% inet 172.21.21.2 netmask 255.255.255.252 up”;
#
route “add -net 10.xx.x.0/26 172.21.21.1”;
route “add -net 0.xx.x.0/26 172.21.21.1”;
#
firewall “reload”;
};
down { ifconfig “%% delete”; firewall “reload”; };
multi killold;
}
starting vtun
/usr/local/sbin/vtund -f /usr/local/etc/vtund.conf freebsd <IP Address>
cek pada ifconfig, jika pesan error “failed to allocate tap device”
ketik pada console
kldload if_tap
cek ifconfig kembali…
Autosart vtun server Reboot
pico /etc/rc.local
#ADD TAP VTUN
kldload if_tap
#Autosart http-accept filter Nginx proxy
echo && echo -n “Loading HTTP/HTTPS Accept filter modules.” && /sbin/kldload accf_http && /sbin/kldload accf_data
echo
##Autostart vtun
/usr/local/sbin/vtund -f /usr/local/etc/vtund.conf freebsd <IP Address>
Posted on: October 18, 2017, by : Julian's | 63 views