Wireguard. Installation

Hi,

these are the steps to install and configure wireguard on a raspberry pi as server.

michael@debdev ~ # sudo apt install wireguard

Generate the server private key

michael@debdev ~ # wg genkey
cNJnQwITOsONCZLpp1G6daBSvgvUBd3gzqQXLMuijmc=

And generate the clients private key

michael@debdev ~ # wg genkey

Create the servers config file

michael@debdev ~ # vi /etc/wireguard/wg0.conf
[Interface]
Address =  10.10.2.1/24
ListenPort = 58888
PrivateKey = cF6Yl9k661OSZFzgBlN7OPEotc9qAS0+GzB14wh16UU=

# Peer 1: WorkingLaptop
[Peer]
PublicKey = WtEJQKNTlX4HfIihoUW630rseGG+3KM6lC1Xv7ewrUQ=
AllowedIPs = 10.10.2.10/32

Enable config wg0

michael@debdev ~ # sudo systemctl enable wg-quick@wg0
michael@debdev ~ # sudo systemctl start wg-quick@wg0

Create a client config

[Interface]
PrivateKey = EDk0yjxBltW0kyJfCzysBqRXWB2X+8mmvN1VylOSZ1g=
Address = 10.10.2.10/24
DNS = 10.10.2.1

[Peer]
PublicKey = AsQUJtZLgHdgKBw0i6X1CiQZ/j7yF/vJl02OVZ4Ai1k=
Endpoint = myyour.vpnserver.org:58888
# Route all traffic through VPN
# AllowedIPs = 0.0.0.0/0
# Route only specific subnets through VPN. Pushing routes from server not possible
AllowedIPs = 10.11.1.0/24, 172.16.31.0/24
michael@debdev ~ # 

Windows Hints

"C:\Program Files\WireGuard\wireguard.exe" /installtunnelservice  %~dp0home.conf

sc stop WireGuardTunnel$home
sc start WireGuardTunnel$home

sc config  WireGuardTunnel$home start=disabled

"C:\Program Files\WireGuard\wg.exe" show

Linux

Windows: Network packet capture with pktmon

Hi,

Windows has a built in tool for network capturing.

List Adapter

pktmon comp list

Capture on interface with ID 8 , this save the packets to C:\Windows\System32\pktmon.etl

pktmon start --capture --comp 8 --pkt-size 0

Stop capturing

pktmon stop

Save as pcap format

pktmon etl2pcap C:\Windows\System32\pktmon.etl --out D:\trace.pcapng

Michael

Windows: Remote Desktop Client returns “internal error”

Hi,

if the remote desktop client return an “internal error” window check if the tls/ssl connection to the RDP port is working correctly:
Continue reading Windows: Remote Desktop Client returns “internal error” →

Unbound: Build (Cross compile on Fedora) it for Windows

Hi,

here are the steps to cross compile the Windows executables for unbound from source on (Fedora 42) linux.
Continue reading Unbound: Build (Cross compile on Fedora) it for Windows →

Smartmeter: vzlogger on Orange Pi Zero with homeassistant integration

Hi,

these are the steps to install vzlogger on an Orange Pi Zero by using a volkszaehler TTL device as interface to get the measures of the electricity meter. Connect the Output to the Pin 10/GPIO199/UART1_RX

First of all install Armbian .
Continue reading Smartmeter: vzlogger on Orange Pi Zero with homeassistant integration →

My Knowledgebase for things about Linux, Windows, VMware, Electronic and so on…