Skip to content

Phils Blog and Stuff

TELECOMS. VIRTUALIZATION. IT. CODING. and more…

Menu
  • Home
  • Resources
    • Subnet Mask Cheat Sheet
    • Easy Dmarc+Email
    • MX Tool Box
    • LOAD BALANCING & SRE
  • SHOP
  • SOLUTIONS
  • SERVICES
  • Contact Me
Menu

Simple Wireguard Config

Posted on 08/03/2023 by Phil

PeerA – 1.1.1.1

wg genkey > privatekey
wg pubkey < privatekey > publickey
ip link add dev wg0 type wireguard
ip address add dev wg0 192.168.2.1/24
ip address add dev wg0 192.168.2.1 peer 192.168.2.2
wg set wg0 listen-port 51820 private-key privatekey peer [PEER_PUBLIC_KEY] allowed-ips 192.168.88.0/24 endpoint 2.2.2.2:8172
ip link set up dev wg0
wg

PeerA – 2.2.2.2

wg genkey > privatekey
wg pubkey < privatekey > publickey
ip link add dev wg0 type wireguard
ip address add dev wg0 192.168.2.1/24
ip address add dev wg0 192.168.2.1 peer 192.168.2.2
wg set wg0 listen-port 51820 private-key privatekey peer [PEER_PUBLIC_KEY] allowed-ips 192.168.88.0/24 endpoint 1.1.1.1:8172
ip link set up dev wg0
wg

WORKING CONFIGS – Config file (/etc/wireguard/demo.conf)

Server1 – PUB_KEY – QVECuXHEgnAkhpGRWiEHHQaMsQl4dy56lZVb0Gmb8mk=

[Interface]
PrivateKey = aBKs+1oplpv03XmMG8qYs4i4sa77Pdobhk6Y2tjZKGo=
Address = 192.168.1.1/24
listenport = 51820

[Peer]
PublicKey = 4S3I92WrdDbmA2vIG9EDha01wWl73mncxEUWeBjd51g=
AllowedIPs = 192.168.1.0/24
Endpoint = 10.10.10.16:51820
PersistentKeepalive = 25

Server2 – PUB_KEY – 4S3I92WrdDbmA2vIG9EDha01wWl73mncxEUWeBjd51g=

[Interface]
PrivateKey = gJicBGf5f7CF4jtYVRZTHZqknFyQ5zJFKSwGcr1MbVI=
Address = 192.168.1.2/24
ListenPort = 51820

[Peer]
PublicKey = QVECuXHEgnAkhpGRWiEHHQaMsQl4dy56lZVb0Gmb8mk=
AllowedIPs = 192.168.1.0/24
Endpoint = 10.10.10.38:51820
PersistentKeepalive = 25

POSTS

  • Home Assistant. Add water meter with PHP+MQTT+YML.
  • Automating your home with Home Assistant. Initial install and config (Hyper-V).
  • The importance of setting up email security correctly.
  • Automate Debian installations with Seed, DHCP and Nginx.
  • A simple link shortener.. Fun little project…

WORD CLOUD

3CX 3CX Phone System Apache Asterisk Cacti CentOS CRM DHCP DNS Email Fail over Failover File System Firewall FreeBSD FreeNAS FXO IAX install IP IP PBX Linux M0n0wall Nottingham Open Source PBX PFSense PHP Router Server SIP snom SSH TrixBox ubuntu VLAN Voice VoIP VPN vyatta WAN Website WiFi yealink ZFS

© 2025 Phils Blog and Stuff | Powered by Superbs Personal Blog theme