I have been running OpenVPN with OpenWRT for a while in order to bridge my home with the office
At home I have a network of 10.0.83.0/24 and at office I have a network of 10.0.10.0/24
Here is the conig at office
proto tcp-server
dev-type tun
dev home_deadlock
ifconfig 10.8.0.1 10.8.0.2
route 10.0.83.0 255.255.255.0
secret home_deadlock.key
And here is the config at home
remote office.address.com
proto tcp-client
dev-type tun
dev home_deadlock
ifconfig 10.8.0.2 10.8.0.1
route 10.0.10.0 255.255.255.0
secret home_deadlock.key
In general this works great. I can reach all office computers from home, and I can reach all home computers from office. But there is a problem that it seem like the traffic is NATed or MASQUARADEd so all traffic seem to come from either 10.8.0.2 or 10.8.0.1 which is the tunnel addresses.
I cant understand why there is NAT here. According to my understanding this is not somethign that OpenVPN is responsible for.
When running iptables -t nat -L -n -v on my home router I get among other things
Chain zone_home_deadlock_postrouting (1 references)
pkts bytes target prot opt in out source destination
19 1216 postrouting_home_deadlock_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* !fw3: user chain for postrouting /
19 1216 MASQUERADE all -- * * 0.0.0.0/0 0.0.0.0/0 / !fw3 */
How can I remove NAT, and why is the traffic NATed? I did not check NAT in Luci web interface except on WAN.
I have not made any special configuration it should be standard, just installed openvpn and have been trying to make it connect the two sites, but something is making the traffic NATed between. I dont know if OpenVPN is doing this or if it is OpenWRT.
Your OpenVPN site-to-site setup doesn't use the iroute option which is typically present and required in such cases and I'm not sure where to put it with no client-config-dir and certificates.
The tested and working configuration is here: server + client + site-to-site.
So you are saying that unless I create certificates and create a client-config dir it is not possible to get this to work? Is there a reference to documentation somewhere that describes that OpenVPN will do NAT unless I use iroute? It would be very interesting to read more about this.