Please need your help with WireGuard & network configuring. I am trying to get access from Office network to Field network through Oracle Cloud WireGuard server. Please take a look on the picture. I've already tried different kind of settings for server & clients but still with no success :( For now what I have is a ping between WireGuard peers. So the main goal is to get an access from 10.10.10.1 to 192.168.0.0/24 (Field Network). Thank you in advance!
There are my current configs:
Office Network (WG settings)
[Interface]
PrivateKey = XXX
Address = 10.10.10.1/32
DNS = 8.8.8.8
[Peer]
PublicKey = XXX
AllowedIPs = 0.0.0.0/0
Endpoint = XXX.XXX.XXX.XXX:XXX
PersistentKeepalive = 20
Oracle Cloud (WG settings)
[Interface]
PrivateKey = XXX
Address = 10.10.10.254/24
ListenPort = 51830
PostUp = /etc/wireguard/helper/add-nat-routing.sh
PostDown = /etc/wireguard/helper/remove-nat-routing.sh
[Peer]
# Office Network
PublicKey = XXX
AllowedIPs = 10.10.10.1/32, 192.168.0.0/24
[Peer]
# Field Network
PublicKey = XXX
AllowedIPs = 10.10.10.2/32, 192.168.0.0/24
Oracle Cloud (iptables settings)
#!/bin/bash
IPT="/sbin/iptables"
IN_FACE="enp0s3" # NIC connected to the internet
WG_FACE="wg0" # WG NIC
SUB_NET="10.10.10.0/24" # WG IPv4 sub/net aka CIDR
WG_PORT="51830" # WG udp port
## IPv4 ##
$IPT -t nat -I POSTROUTING 1 -s $SUB_NET -o $IN_FACE -j MASQUERADE
$IPT -I INPUT 1 -i $WG_FACE -j ACCEPT
$IPT -I FORWARD 1 -i $IN_FACE -o $WG_FACE -j ACCEPT
$IPT -I FORWARD 1 -i $WG_FACE -o $IN_FACE -j ACCEPT
$IPT -I FORWARD 1 -i $WG_FACE -o $WG_FACE -j ACCEPT
$IPT -I INPUT 1 -i $IN_FACE -p udp --dport $WG_PORT -j ACCEPT
sysctl -q -w net.ipv4.ip_forward=1
Field Network (WG settings)
[Interface]
PrivateKey = XXX
Address = 10.10.10.2/32
DNS = 8.8.8.8
[Peer]
PublicKey = XXX
AllowedIPs = 0.0.0.0/0
Endpoint = XXX.XXX.XXX.XXX:XXX
PersistentKeepalive = 20