Hi, I've been working on replacing my Raspberry Pi which is today my OpenvPN Server.
I'd like to have my ER-Poe5 as OpenVPN Server.
It's been a week of complete Reset the device bescause I'va made incorrect settings and distroyed my actual setting...
Here is the topology of my Network :
ETH0 (WAN1) => 4G Modem (yes I know, I've got 3Mo of ADSL...) can't BRIDGE the modem
ETH1 (WAN2) => ADSL can't BRIDGE the modem
ETH2 => IP CCTV
ETH3 => Ubiquiti UAC Pro
ETH4 => LAN
Switch => ETH2 + ETH3 + ETH4
LAN for ETH0 is 192.168.8.0/24 subnet
LAN for ETH1 is 192.168.1.0/24 subnet
LAN for SWITCH is 192.168.10.0/24 subnet
The actual setting is that ETH1 is failover ETH0, so when I loose my 4G connection I've got the ADSL connection : that's working lovely !
Now what I want is the following : I want OpenVPN server working as it is today with WAN failover, and when I want to connect to it, it should use the ADSL connection to get to my LAN from outside.
I hope you'll understand my problem and have any idea what it is not working today
I thinking my problem is a NAT thing but I can't figure it out...
Here's a cat of my conf :
root@FW-UBNT:~# show configuration | cat
firewall {
all-ping enable
broadcast-ping disable
group {
address-group RaspberryPi {
address 192.168.10.20
description "Raspberry Pi 2 B / OpenVPN"
}
address-group Synology {
address 192.168.10.19
description "NAS Synology DS415+"
}
network-group PRIVATE_NETS {
network 192.168.0.0/16
network 172.16.0.0/12
network 10.0.0.0/8
}
}
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians disable
modify balance {
rule 10 {
action modify
description "do NOT load balance lan to lan"
destination {
group {
network-group PRIVATE_NETS
}
}
modify {
table main
}
}
rule 20 {
action modify
description "do NOT load balance destination public address"
destination {
group {
address-group ADDRv4_eth0
}
}
modify {
table main
}
}
rule 30 {
action modify
description "do NOT load balance destination public address"
destination {
group {
address-group ADDRv4_eth1
}
}
modify {
table main
}
}
rule 70 {
action modify
modify {
lb-group G
}
}
}
name WAN_IN {
default-action drop
description "WAN to internal"
rule 10 {
action accept
description Allow_OpenVPN
destination {
group {
address-group RaspberryPi
}
port 443
}
log disable
protocol tcp
}
rule 20 {
action accept
description Allow_NASHTTPS
destination {
group {
address-group Synology
}
port 5001
}
log disable
protocol tcp
source {
}
}
rule 30 {
action accept
description Allow_NASHTTP
destination {
group {
address-group Synology
}
port 5000
}
log disable
protocol tcp
}
rule 40 {
action accept
description Allow_HTTP
destination {
group {
address-group Synology
}
port 80
}
log disable
protocol tcp
}
rule 50 {
action accept
description Allow_Webdav
destination {
group {
address-group Synology
}
port 5006
}
log disable
protocol tcp
}
rule 60 {
action accept
description "Allow established/related"
state {
established enable
related enable
}
}
rule 70 {
action drop
description "Drop invalid state"
state {
invalid enable
}
}
}
name WAN_LOCAL {
default-action drop
description "WAN to router"
rule 10 {
action accept
description "Allow OpenVPN UBNT"
destination {
port 1194
}
log disable
protocol udp
}
rule 20 {
action accept
description "Allow established/related"
state {
established enable
related enable
}
}
rule 30 {
action drop
description "Drop invalid state"
state {
invalid enable
}
}
}
receive-redirects disable
send-redirects enable
source-validation disable
syn-cookies enable
}
interfaces {
ethernet eth0 {
address dhcp
description WAN
duplex auto
firewall {
in {
name WAN_IN
}
local {
name WAN_LOCAL
}
}
poe {
output off
}
speed auto
}
ethernet eth1 {
address dhcp
description "WAN 2"
duplex auto
firewall {
in {
name WAN_IN
}
local {
name WAN_LOCAL
}
}
poe {
output off
}
speed auto
}
ethernet eth2 {
description Foscam
duplex auto
mtu 1500
poe {
output 48v
}
speed auto
}
ethernet eth3 {
description Wifi
duplex auto
mtu 1500
poe {
output 48v
}
speed auto
}
ethernet eth4 {
description Lan
duplex auto
mtu 1500
poe {
output off
}
speed auto
}
loopback lo {
}
openvpn vtun0 {
description OpenVPN
encryption aes256
hash sha256
mode server
openvpn-option "--port 1194"
openvpn-option --tls-server
openvpn-option "--comp-lzo yes"
openvpn-option --persist-key
openvpn-option --persist-tun
openvpn-option "--keepalive 10 120"
openvpn-option "--user nobody"
openvpn-option "--group nogroup"
server {
name-server 8.8.8.8
push-route 192.168.10.0/24
subnet 172.16.1.0/24
}
tls {
ca-cert-file /config/auth/cacert.pem
cert-file /config/auth/host.pem
dh-file /config/auth/dh2048.pem
key-file /config/auth/host-decrypted.key
}
}
switch switch0 {
address 192.168.10.253/24
description Local
firewall {
in {
modify balance
}
}
mtu 1500
switch-port {
interface eth2 {
}
interface eth3 {
}
interface eth4 {
}
vlan-aware disable
}
}
}
load-balance {
group G {
interface eth0 {
}
interface eth1 {
failover-only
}
lb-local enable
lb-local-metric-change disable
}
}
port-forward {
auto-firewall enable
hairpin-nat enable
lan-interface eth4
rule 1 {
description LetsEncrypt
forward-to {
address 192.168.10.19
port 80
}
original-port 80
protocol tcp
}
rule 2 {
description NAS-WebDav
forward-to {
address 192.168.10.19
port 5006
}
original-port 5006
protocol tcp_udp
}
rule 3 {
description NAS_HTTPS
forward-to {
address 192.168.10.19
port 5001
}
original-port 5001
protocol tcp
}
wan-interface eth1
}
protocols {
static {
route 172.16.1.0/24 {
next-hop 192.168.10.253 {
}
}
route 192.168.10.0/24 {
next-hop 172.16.1.1 {
}
}
}
}
service {
dhcp-server {
disabled false
hostfile-update disable
shared-network-name LAN {
authoritative enable
subnet 192.168.10.0/24 {
default-router 192.168.10.253
dns-server 1.1.1.1
dns-server 8.8.8.8
lease 86400
start 192.168.10.100 {
stop 192.168.10.200
}
unifi-controller 192.168.10.251
}
}
static-arp disable
use-dnsmasq disable
}
dns {
forwarding {
cache-size 150
listen-on switch0
listen-on vtun0
}
}
gui {
http-port 80
https-port 443
older-ciphers enable
}
nat {
rule 1 {
description Allow_OpenVPN
inbound-interface eth1
inside-address {
address 192.168.10.20
port 443
}
log disable
protocol tcp
type destination
}
rule 2 {
description Allow_NAStoHTTPS
destination {
group {
}
}
inbound-interface eth1
inside-address {
address 192.168.10.19
}
log disable
protocol all
type destination
}
rule 5000 {
description "masquerade for WAN"
outbound-interface eth0
type masquerade
}
rule 5002 {
description "masquerade for WAN 2"
outbound-interface eth1
type masquerade
}
}
ssh {
port 522
protocol-version v2
}
unms {
disable
}
}
system {
conntrack {
expect-table-size 4096
hash-size 4096
table-size 32768
tcp {
half-open-connections 512
loose enable
max-retrans 3
}
}
host-name FW-UBNT
login {
user jessy {
authentication {
encrypted-password ****************
plaintext-password ****************
}
full-name jessy
level admin
}
user ubnt {
authentication {
encrypted-password ****************
}
level admin
}
}
ntp {
server 0.ubnt.pool.ntp.org {
}
server 1.ubnt.pool.ntp.org {
}
server 2.ubnt.pool.ntp.org {
}
server 3.ubnt.pool.ntp.org {
}
}
syslog {
global {
facility all {
level notice
}
facility protocols {
level debug
}
}
}
time-zone UTC
traffic-analysis {
dpi enable
export enable
}
}
THANK YOU for having a look at it !
Sorry for any mistakes I'm French.
Regards