Score:0

How to source NAT on Ubuntu Server when accessing from wireguard interface to access server LAN environment

gw flag

I have an Ubuntu Server 22.04 which I am accessing from wireguard interface 10.69.69.0/24, But I am having trouble accessing it's LAN environment on 10.0.0.0/24

I understand I need to do some source nat but I am not sure of the correct commands.

  • From my laptop I can ping 10.69.69.0/24 & 10.0.0.50 but not anything else on 10.0.0.0/24
  • From my server I can ping 10.69.69.0/24 and 10.0.0.0/24

I need to make the server when sending packets to 10.0.0.0/24 from 10.69.69.0/24 to change the source IP to 10.0.0.50 right?

Server:

  • eno1: 10.0.0.50/24
  • wg0: 10.69.69.10/24
  • net.ipv4.ip_forward = 1

Laptop:

  • wg0: 10.69.69.1/24

Thank you

vidarlo avatar
ar flag
In my opinion, NAT is when you don't have other choices. Here you have; everything's inside a RFC1918 network. Simply set up appropriate routes.
Score:0
al flag

This is more of a comment. It seems like that devices on the lan 10.0.0.0/24 don't know where the network 10.69.69.0/24 resides. If the lan has another exit point like Internet, you can install a route for 10.69.69.0/24 in the gateway for the lan 10.0.0.0/24. Or as you said, you can source NAT.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.