VPN (IP Failover)

Luis Velázquez

New Member
Dec 20, 2022
3
0
1
Hello everyone:

I have created an lcx as indicated in the tutorial to be able to host a VPN. I have assigned an Additional IP to it, to be able to directly access the VPN from the Internet.

I have several VPS and I want to be able to access them internally from the VPN, but only access the necessary services from the outside, to keep the server as secure as possible.

I have managed to connect to the VPN, but once connected I lose Internet connection and also, I do not have access to my VPS internally.

My interface configuration is:

Code:
auto lo
iface lo inet loopback

#auto eth0
iface eth0 inet static
        address 87.91.178.217/32
        post-up ip route add 48.105.83.244 dev eth0
        post-up ip route add default via 48.105.83.244
        pre-down ip route del 48.105.83.244 dev eth0
        pre-down ip route del default via 48.105.83.244

#auto eth1
iface eth1 inet static
        address 10.8.0.2/27
        gateway 10.8.0.1

One more thing, in the main PROXMOX server I have 2 Bridges:
vmbr0 (Public IP)
vmbr1 (Private IP)

In the LXC of the VPN I have 2 net devices:
eth0 (Public IP) with vmbr0
eth1 (Private IP) with vmbr1

Can you help me with the configuration? What reason prevents me from having the Internet connected to the VPN and at the same time not seeing the local VPS?
 
Last edited:
Hi,

Can you please share the tutorial you followed?

For now, I guess the reason is the resolv.conf
 
Hello, thanks for the answer!

Well, the tutorial is this: https://pve.proxmox.com/wiki/OpenVPN_in_LXC

And my resolv.conf file configuration is:

Code:
# --- BEGIN PVE ---
search local
nameserver 8.8.8.8
nameserver 8.8.4.4
# --- END PVE ---

Add my server.conf config (OpenVpn):
Code:
local 87.91.178.217
port 1105
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 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "block-outside-dns"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
verb 3
crl-verify crl.pem
explicit-exit-notify
 
Last edited:
Yes, my file /etc/resolv.conf have 8.8.8.8, in the previous post you can view the config file. ¿Any ideas?

I config iptables too: (my port VPN is 1105)

Code:
iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 1105 -j DNAT --to 10.8.0.2:1105
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!