A host in the LAN acts as the OpenVPN server listening on a port forwarded from the public static IP of the commercial VPN, and runs a OpenVPN client connected to the commercial server with a static IP
On host 10.0.0.56
my server OpenVPN conf
Code: Select all
;local 10.117.226.39
port 18914
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 "route 10.0.0.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.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
Again on host 10.0.0.56
commercial VPN client.conf
Code: Select all
client
dev tun
proto udp
remote <obscured_public_static_ip> 443
nobind
auth-user-pass
resolv-retry infinite
cipher AES-256-GCM
ncp-ciphers AES-256-GCM:AES-256-CBC:AES-128-GCM
auth SHA512
compress lzo
verb 2
mute-replay-warnings
remote-cert-tls server
persist-key
persist-tun
my client OpenVPN conf
Code: Select all
dev tun
proto udp
remote <obscured_public_static_ip> 18914
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3
Configured also:
- a static route on LAN gateway
for net 10.8.0.0/24 destination 10.0.0.56 (LAN ip of the OpenVPN server)
- ip_forward = 1 on 10.0.0.56 host
server 10.0.0.56 route table
Code: Select all
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.117.226.1 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun1
10.117.226.0 0.0.0.0 255.255.254.0 U 0 0 0 tun0
<obscured_public_static_ip> 10.0.0.1 255.255.255.255 UGH 0 0 0 eth0
128.0.0.0 10.117.226.1 128.0.0.0 UG 0 0 0 tun0
eth0: LAN interface
tun0: OpenVPN client interface
remote client 10.8.0.4 route table
Code: Select all
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 10.8.0.1 255.255.255.0 UG 50 0 0 tun0
10.8.0.0 0.0.0.0 255.255.255.0 U 50 0 0 tun0
given client 10.8.0.4 executing the command:
Code: Select all
nping --tcp -p 64000 10.0.0.2
wireshark on OpenVPN server
Code: Select all
Source Destination
10.8.0.4 10.0.0.2 TCP 56 4149 → 64000 [SYN] Seq=0 Win=1480 Len=0
10.117.226.35 10.0.0.2 TCP 56 4149 → 64000 [SYN] Seq=0 Win=1480 Len=0
Code: Select all
Source Destination
10.117.226.35 10.0.0.2 TCP 60 4149 → 64000 [SYN] Seq=0 Win=1480 Len=0
The request should get to the host with a source:10.8.0.0/24 or source:10.0.0.0/24, but I don't really know where to put my hands to get this result.
I can't get access to the LAN hosts with the current setup, I really could use a help, thank you