Route all traffic by OpenVPN

In October i posted a blog about setting up your OpenVPN server in 2 minutes.

This blog is a addon to your existing configuration to route all traffic over the VPN. 

Change server configuration

go to the config file (/etc/openvpn/server.conf) and add the following lines:

push "redirect-gateway def1"
push "dhcp-option DNS "
push "dhcp-option DNS 1.1.1.1"

 Restart your OpenVPN daemon

sudo /etc/init.d/openvpn restart

Change client configuration

Change your client config, and add the following line

redirect-gateway def1

Change IP Tables

Last thing to do is change your iptables to NAT traffic to the internet. (make sure you have the right to do this or run this as root)

iptables -I FORWARD -i tun0 -o wlan0 \
         -s 10.8.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED \
         -j ACCEPT
iptables -t nat -I POSTROUTING -o wlan0 \
          -s 10.8.0.0/24 -j MASQUERADE

Caption:

  • tun0: your virtual VPN network interface
  • eth0: your normal network interface (to make sure you will use the right interface, check with “ifconfig”)
  • 10.8.0.0: your VPN network IP range

Running PowerShell on your RaspberryPi

microsoft loves linux

For many years PowerShell was a Windows-only thing that was part of the closed Windows ecosystem. Now a days PowerShell is open source up at https://github.com/PowerShell with lots of docs and scripts, also open source.

PowerShell is supported on Windows, Mac, and a half-dozen Linux distros.

While running PowerShell on your RaspberryPi is still experimental and only supported for Raspbian Stretch it’s running pretty smoothly.

Continue Reading

Move VMs between ESXi Hosts with SSH

Recently is had some issues with capacity and old server hardware. I created some new ESXi hosts and wanted to move the VMs to the new hosts. Below i will describe how i obtained this:

Setup Access

Start SSH and ESXi Shell on both servers, you can do this from the Web UI, Hosts > Actions > Services

Now create the destination folder (mostly VM name) on the new ESXi host.

You must create the folder on the destination datastore before performing the copy

Continue Reading