I really don't understand the global settings of OpenVPN, but I'm familiar with the basic ones.
There is a local network 192.168.5.0/24
In this network there is a router (looking at the Internet) and a DHCP Server 192.168.5.1/24
In this network there is a server 192.168.5.11/24, on which VirtualBox is installed, guest system Ubuntu 22.04 (OpenVPN Server) in local bridge mode, 192.168.5.51/24
There are also other network clients 192.168.5.10/24 and so on
Since I couldn't configure OpenVPN server on my own, I used the script and basically everything works, vpn network 10.8.0.0/24
But in my task there is a condition that I cannot implement, I need clients of the local network 192.168.5.0/24 to be able to connect to vpn clients that have the address 10.8.0.2/24, the vpn client's LAN address 192.168.10.0/24, he has his own router and internet access
By pinging from the PC 192.168.5.10, I was able to reach 10.8.0.1 (OpenVPN Server), but not 10.8.0.2
After I registered the route 10.8.0.0/24 192.168.5.51 on the router, this gave me the opportunity to ping 10.8.0.2
It turned out that LAN clients can ping vpn clients, but at the same time I can't connect via samba to //10.8.0.2/C$ - he is //192.168.10.16/C$
Accordingly, the clients of the network 192.168.5.0 do not know about the existence of the remote network 192.168.10.0, respectively //192.168.10.16/C$ also does not work and there is no ping to 192.168.10.16
In order to have access from the vpn server to the vpn client, I temporarily completely disable the firewall of the windows client.
As far as I understand, we need a route on the server 192.168.10.0/24 dev tun0, which is not there
Maybe there is some parameter in the script itself, with which I create an OpenVPN server, or in the configuration of the server itself, which does not allow me to make such a connection?
I also watched the script itself and as I understand it, a non-standard iptables is specified in it
On my own, I did not configure iptables and routing on OpenVPN Server and in Ubuntu itself
There is also a file that I learned about after studying the script, the file is located /etc/systemd/system/openvpn-iptables.service
server.conf
local 192.168.5.51
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 192.168.5.1"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
verb 3
crl-verify crl.pem
explicit-exit-notify
[/code]