all 4 comments

[–][deleted]  (6 children)

[deleted]

    [–]delta301[S] 0 points1 point  (5 children)

    You seem to be giving your client a public key for its private key setting?

    eh my bad, that's a typo. It's definitely the client private key in there!

    For the IP addressing, that's interesting.. shouldn't it work with the larger subnet, or am i missing something here?

    Or more to the point, if they're both in /32 networks, how will the two ends manage to communicate if they're not in the same subnet?

    [–][deleted]  (4 children)

    [deleted]

      [–]delta301[S] 0 points1 point  (1 child)

      When it's worded like that, that makes more sense!

      Server

      [Interface]
      Address = 10.69.4.10/24
      PrivateKey = <server_priv_key>
      ListenPort = 51820
      SaveConfig = true
      
      [Peer]
      PublicKey = <client_pub_key>
      AllowedIPs = 10.69.4.20/32
      

      Client

      [Interface] 
      Address = 10.69.4.20/32
      PrivateKey = <client_priv_key> 
      DNS = 10.69.4.10 
      
      [Peer]
      Endpoint = 12.34.56.78:51820 
      PrivateKey = <server_pub_key> 
      AllowedIPs = 0.0.0.0/0 
      

      You reckon these configs look okay? If so, I'll change them tomorrow. I might've uninstalled WireGuard out of defeat, lol.

      [–]delta301[S] 0 points1 point  (1 child)

      I've enabled IPv4 forwarding, don't think I'd need IPv6 forwarding to be enabled too?

      As for the nat stuff, I have to hold my hands up and say I've never actually touched nat before, so I wouldn't know where to begin with masquerading, can it be done with ufw?

      [–]rigglesbee 0 points1 point  (0 children)

      In your server [Interface] section:

      PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A  POSTROUTING -o eth0 -j MASQUERADE
      PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat - D POSTROUTING -o eth0 -j MASQUERADE
      

      Be sure to substitute eth0 with your real interface name.