Wireguard with Oracle Cloud free tier

  • Thread starter Thread starter panks21
  • Start date Start date
  • Replies Replies 8
  • Views Views 6,309
Messages
258
Location
Delhi
ISP
Airtel Static IP
ACT Broadband
Anyone with wireguard experience on oracle cloud, please help.
I spinup a Ubuntu 22.04 VM.Standard.E2.1.Micro (Always free) on Oracle cloud and trying to create a site-2-site wireguard tunnel from debian machine at home. I have static IP at home.
the VM at home sees both incoming and outgoing packets but the VM on the cloud does not see any incoming packets. I have allowed the required port on the security list for my VM instance

VM at Home
Code:
interface: wg0
  public key: <home-debian-public-key>
  private key: (hidden)
  listening port: 40195

peer: <oci-ubuntu-public-key>
  endpoint: <oci-public-ip>:40195
  allowed ips: 10.23.44.2/32, 10.0.44.0/24
  transfer: 14.89 KiB received, 44.66 KiB sent
  persistent keepalive: every 15 seconds

VM at Oracle Cloud
Code:
interface: wg0
  public key: <oci-ubuntu-public-key>
  private key: (hidden)
  listening port: 40195

peer: <home-debian-public-key>
  endpoint: <home-public-ip>:40195
  allowed ips: 10.23.44.1/32, 192.168.50.128/25, 192.168.50.0/25
  transfer: 0 B received, 2.89 KiB sent


No<home-public-ip>/32UDPAll40195UDP traffic for ports: 40195Wireguard Port
 
The oracle ubuntu image has all the ports closed by default. An easy workaround is to flush all iptables rules and make them persistent on reboot.

Code:
sudo iptables -F

sudo netfilter-persistent save
 
thanks @royalroy. Its working now

Code:
interface: wg0
  public key: <oci-ubuntu-public-key>
  private key: (hidden)
  listening port: 40195

peer: <home-debian-public-key>
  endpoint: <home-public-ip>:40195
  allowed ips: 10.23.44.1/32, 192.168.50.128/25, 192.168.50.0/25
  latest handshake: 56 seconds ago
  transfer: 755.90 KiB received, 3.54 MiB sent
 
Back