Access Local IPs of VM after Connecting VPN

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
bharatvashist
OpenVpn Newbie
Posts: 1
Joined: Fri Jul 07, 2023 12:53 pm

Access Local IPs of VM after Connecting VPN

Post by bharatvashist » Fri Jul 07, 2023 12:56 pm

Hello,

I've basically trying for days to achieve this. So basically, simply i just want to connect to Local IPs of VM Once we are connected to VPN Client. All VPN Server and VMs are located on Same VLAN and Private Subnet.

VPN Server has 2 NIC for Public as well as Private IP.
VPN Server Public IP is xx.xx.xx.xx
VPN Server Private IP is 192.168.1.100


VM 1 : zen-srv01.zenoptics.com - 192.168.1.2
VM 2 : zen-srv02.zenoptics.com - 192.168.1.3
VM 3 : zen-srv03.zenoptics.com - 192.168.1.4
VM 4 : zen-srv04.zenoptics.com - 192.168.1.5
VM 5 : zen-srv05.zenoptics.com - 192.168.1.6
VM 6 : zen-srv06.zenoptics.com - 192.168.1.7

Now all VMs and also VPN Server are on same Private Subnet, also we want once we connect to VPN it should be able to access VMs domain locally

I've also set PowerDNS on xx.xx.xx.x1.

My Server.Conf

Code: Select all

[root@compu8 ~]# cat /etc/openvpn/server.conf 
port 1194 
proto udp 
dev tun 
user nobody 
group nobody 
persist-key 
persist-tun 
keepalive 10 120 
topology subnet 
server 10.8.0.0 255.255.255.0 
ifconfig-pool-persist ipp.txt 
push "redirect-gateway def1 bypass-dhcp" 
dh none 
ecdh-curve prime256v1 
tls-crypt tls-crypt.key 
crl-verify crl.pem 
ca ca.crt 
cert server_IXfeqzJbEdNnwF3E.crt 
key server_IXfeqzJbEdNnwF3E.key 
auth SHA256 
cipher AES-128-GCM 
ncp-ciphers AES-128-GCM 
tls-server 
tls-version-min 1.2 
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 
client-config-dir /etc/openvpn/ccd 
status /var/log/openvpn/status.log 
verb 3 
max-clients 10 
push "route-ipv6 ::/0" 
push "route 192.168.1.0 255.255.255.0" 
push "dhcp-option DNS xx.xx.xx.x1" 
push "block-outside-dns"
My Client.OVPN Config:

Code: Select all

client 
proto udp 
explicit-exit-notify 
remote xx.xx.xx.xx 1194 
dev tun 
resolv-retry infinite 
nobind 
persist-key 
persist-tun 
remote-cert-tls server 
verify-x509-name server_IXfeqzJbEdNnwF3E name 
auth SHA256 
auth-nocache 
cipher AES-128-GCM 
tls-client 
tls-version-min 1.2 
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 
verb 3 
pull-filter ignore "ifconfig-ipv6" 
dhcp-option DNS xx.xx.xx.x1
block-outside-dns
VPN Server IP Route:

Code: Select all

[root@compu8 ~]# ip route show 
default via 46.17.102.1 dev eth0 
10.8.0.0/24 via 192.168.1.100 dev eth1 
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1 
46.17.102.0/24 dev eth0 proto kernel scope link src xx.xx.xx.xx 
46.17.102.1 dev eth0 scope link 
169.254.0.0/16 dev eth0 scope link metric 1002 
169.254.0.0/16 dev eth1 scope link metric 1003 
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.100
I'm just very much unsure what should i do in this regard?

Thanks

Post Reply