Hello.
I have the next structure in my Opnsense:
1. WAN interface - access to the Internet via home router
2. LAN interface 1 - private network 192.168.30.1/24
2. LAN interface 2 - private network 192.168.40.1/24
Everything is working correctly. I have access to the Internet from each LAN network.
Also I have 2 OpenVPN servers with the next configurations:
OpenVPN server 1:
local 1.1.1.1
port 1594
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
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"
user nobody
group nobody
persist-key
persist-tun
crl-verify crl.pem
explicit-exit-notify
OpenVPN server 2:
local 2.2.2.2
port 1595
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
auth SHA512
tls-crypt tc.key
topology subnet
server 10.7.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"
user nobody
group nobody
persist-key
persist-tun
crl-verify crl.pem
explicit-exit-notify
OpenVPN clients on OpnSense are working correctly!!!!
But there is one but.
They are working correctly only when one of them is running.
OpenVPN clients are not working when they are run together.
The problem is in push "redirect-gateway def1 bypass-dhcp" parameter in OpenVPN server configuration.
OpnSense can't add the same routes:
0.0.0.0/1 and 128.0.0.0/1
And in logs I see
ERROR: FreeBSD route add command failed: external program exited with error status: 1
ERROR: FreeBSD route add command failed: external program exited with error status: 1
When I'm not using the push "redirect-gateway def1 bypass-dhcp" option two OpenVPNs clients are working, but public IP doesn't change to IPs OpenVPNs server.
I need to change my public IP when I'm connecting to the VPNs.
How can I solve the problem?