Openvpn client Freebsd


  • administrators

    Basic openvpn client Freebsd

    pkg install openvpn
    
    sysrc openvpn_enable="YES"
    
    sysrc openvpn_if="tun"
    

    Place your openvpn config file in a location unavailable to other users.

    Insure your <openvpn>.conf contains the proper tunnel name, in this case I:undefined:’:undefined:ll use :undefined:‘:undefined:tun:undefined:’:undefined:


    This guide is basic! For simplicity of getting started; As well,service openvpn start is not required or needed in this situation!

    service openvpn start
    

    cd into the directory of your config file

    then:openvpn config.conf

    Output:

    Fri Nov 10 04:45:43 2017 library versions: OpenSSL 1.0.2k-freebsd  26 Jan 2017, LZO 2.10
    Enter Auth Username:
    Enter Auth Password:
    Fri Nov 10 04:45:50 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]<ip and port will print here>
    Fri Nov 10 04:45:50 2017 UDP link local (bound): [AF_INET][undef]:0
    Fri Nov 10 04:45:50 2017 UDP link remote: [AF_INET]<ip and port will print here>
    Fri Nov 10 04:45:50 2017 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
    Fri Nov 10 04:45:50 2017 [rick] Peer Connection Initiated with [AF_INET]<ip and port will print here>
    Fri Nov 10 04:45:51 2017 TUN/TAP device /dev/tun0 opened
    Fri Nov 10 04:45:51 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
    Fri Nov 10 04:45:51 2017 /sbin/ifconfig tun0 10.10.2.10 10.10.2.9 mtu 1500 netmask 255.255.255.255 up
    add net <ip will print here>: gateway 10.10.5.1
    add net 0.0.0.0: gateway 10.10.2.9
    add net 128.0.0.0: gateway 10.10.2.9
    add net 10.10.1.0: gateway 10.10.2.9
    add net 10.10.2.1: gateway 10.10.2.9
    Fri Nov 10 04:45:51 2017 Initialization Sequence Completed
    

    As you can see there is a prompt for username and password. This can be circumvented, as well as starting the connection at boot. However this is just to get you going.

    There is much more to learn!


  • administrators

    Hint:

    kldload if_tun
    

 



  • Make ISO from DVD

    In this case I had an OS install disk which was required to be on a virtual node with no optical drive, so I needed to transfer an image to the server to create a VM

    Find out which device the DVD is:

    lsblk

    Output:

    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 464.8G 0 part ├─centos-root 253:0 0 50G 0 lvm / ├─centos-swap 253:1 0 11.8G 0 lvm [SWAP] └─centos-home 253:2 0 403G 0 lvm /home sdb 8:16 1 14.5G 0 disk /mnt sr0 11:0 1 4.1G 0 rom /run/media/rick/CCSA_X64FRE_EN-US_DV5

    Therefore /dev/sr0 is the location , or disk to be made into an ISO

    I prefer simplicity, and sometimes deal with the fallout after the fact, however Ive repeated this countless times with success.

    dd if=/dev/sr0 of=win10.iso

    Where if=Input file and of=output file

    I chill out and do something else while the image is being copied/created, and the final output:

    8555456+0 records in 8555456+0 records out 4380393472 bytes (4.4 GB) copied, 331.937 s, 13.2 MB/s

    Fin!

    read more
  • Recreate postrgresql database template encode to ASCII

    UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';

    Now we can drop it:

    DROP DATABASE template1;

    Create database from template0, with a new default encoding:

    CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE'; UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'; \c template1 VACUUM FREEZE;

    read more
});