Using an Edgerouter X on v1.10.5 firmware
I'm unable to connect via VPN a pppoe's WAN connection.
eth0 is connected as WAN to a cable modem (Telenet specifc brand) in bridged mode using dhcp
eth1 is connected as WAN to a VDSL modem (BBox 3V+) in bridged mode using pppoe
thus a pppoe1 interface exists with MTU1492
both eth0 and pppoe1 have a working dyndns hostname.
When I configure the VPN settings according to the following help artciel EdgeRouter - L2TP IPsec VPN Server
It works when connecting throught the Telenet internet connecting and it's corresponding external ip address. But I can't the VPN connection up when using the external ip address of the pppoe1 connection.
ipsec and sa come up, but then something seems to be failing and timeing out.
thus users and passwords, passphrases are correct.
The strange thing is, even when configuring pppoe1 as the external wan interface to use for the VPN connection, when connecting to the external ip of the eth0 WAN interface the VPN conection is established.
firewall {
all-ping enable
broadcast-ping disable
group {
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_pppoe1
}
}
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 established/related"
state {
established enable
related enable
}
}
rule 20 {
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 established/related"
state {
established enable
related enable
}
}
rule 20 {
action drop
description "Drop invalid state"
state {
invalid enable
}
}
rule 30 {
action accept
description ike
destination {
port 500
}
log disable
protocol udp
}
rule 40 {
action accept
description esp
log disable
protocol esp
}
rule 50 {
action accept
description nat-t
destination {
port 4500
}
log disable
protocol udp
}
rule 60 {
action accept
description l2tp
destination {
port 1701
}
ipsec {
match-ipsec
}
log disable
protocol udp
}
}
options {
mss-clamp {
mss 1412
}
}
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
}
}
speed auto
}
ethernet eth1 {
description "WAN 2"
duplex auto
pppoe 1 {
default-route auto
firewall {
in {
name WAN_IN
}
local {
name WAN_LOCAL
}
}
mtu 1492
name-server auto
password ****************
user-id pppoe-username
}
speed auto
}
ethernet eth2 {
duplex auto
speed auto
}
ethernet eth3 {
duplex auto
speed auto
}
ethernet eth4 {
duplex auto
speed auto
}
loopback lo {
}
switch switch0 {
address 192.168.1.1/24
description Local
firewall {
in {
modify balance
}
}
switch-port {
interface eth2 {
}
interface eth3 {
}
interface eth4 {
}
}
}
}
load-balance {
group G {
interface eth0 {
}
interface pppoe1 {
}
}
}
service {
dhcp-server {
disabled false
hostfile-update disable
shared-network-name LAN {
authoritative enable
subnet 192.168.1.0/24 {
default-router 192.168.1.1
dns-server 192.168.1.1
dns-server 1.1.1.1
domain-name local.lan
lease 86400
start 192.168.1.38 {
stop 192.168.1.180
}
}
}
}
dns {
dynamic {
interface eth0 {
service dyndns {
host-name home.example.org
login example.org-home
password ****************
server www.example.org
}
}
interface pppoe1 {
service dyndns {
host-name dslhome.example.org
login example.org-dsl
password ****************
server example.org
}
}
}
forwarding {
cache-size 150
listen-on switch0
options listen-address=192.168.1.1
}
}
gui {
https-port 443
}
nat {
rule 5000 {
description "masquerade for WAN"
outbound-interface eth0
type masquerade
}
rule 5002 {
description "masquerade for WAN 2"
outbound-interface pppoe1
type masquerade
}
}
ssh {
port 22
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
}
}
domain-name local.lan
host-name edge
login {
user admin {
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 Europe/Brussels
}
vpn {
ipsec {
ipsec-interfaces {
interface pppoe1
}
}
l2tp {
remote-access {
authentication {
local-users {
username exampleuser {
password ****************
}
}
mode local
}
client-ip-pool {
start 192.168.1.190
stop 192.168.1.199
}
dns-servers {
server-1 192.168.1.1
server-2 1.1.1.1
}
ipsec-settings {
authentication {
mode pre-shared-secret
pre-shared-secret ****************
}
}
mtu 1392
outside-address 0.0.0.0
}
}
}
After the initial wizard setup for a loadbalanced system I added the dyndns hostnames.
Then I added these settings for the eth0 VPN setup:
set firewall name WAN_LOCAL rule 30 action accept
set firewall name WAN_LOCAL rule 30 description ike
set firewall name WAN_LOCAL rule 30 destination port 500
set firewall name WAN_LOCAL rule 30 log disable
set firewall name WAN_LOCAL rule 30 protocol udp
set firewall name WAN_LOCAL rule 40 action accept
set firewall name WAN_LOCAL rule 40 description esp
set firewall name WAN_LOCAL rule 40 log disable
set firewall name WAN_LOCAL rule 40 protocol esp
set firewall name WAN_LOCAL rule 50 action accept
set firewall name WAN_LOCAL rule 50 description nat-t
set firewall name WAN_LOCAL rule 50 destination port 4500
set firewall name WAN_LOCAL rule 50 log disable
set firewall name WAN_LOCAL rule 50 protocol udp
set firewall name WAN_LOCAL rule 60 action accept
set firewall name WAN_LOCAL rule 60 description l2tp
set firewall name WAN_LOCAL rule 60 destination port 1701
set firewall name WAN_LOCAL rule 60 ipsec match-ipsec
set firewall name WAN_LOCAL rule 60 log disable
set firewall name WAN_LOCAL rule 60 protocol udp
set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret
set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret examplepassphrase
set vpn l2tp remote-access authentication mode local
set vpn l2tp remote-access authentication local-users username exampleuser password examplepassword
set vpn l2tp remote-access client-ip-pool start 192.168.1.190
set vpn l2tp remote-access client-ip-pool stop 192.168.1.199
set vpn l2tp remote-access dns-servers server-1 192.168.1.1
set vpn l2tp remote-access dns-servers server-2 1.1.1.1
set vpn l2tp remote-access dhcp-interface eth0
set vpn ipsec ipsec-interfaces interface eth0
set vpn l2tp remote-access mtu 1392
This configuration seems to be working when connecting through the eth0 WAN ip
However after deleting the vpn settings (delete vpn l2tp ; delete vpn ipsec)
and the configuration setup for the pppoe1 usage, the VPN connection doesn't establish through the pppoe interface, but it still works through the eth0 interface.
set firewall name WAN_LOCAL rule 30 action accept
set firewall name WAN_LOCAL rule 30 description ike
set firewall name WAN_LOCAL rule 30 destination port 500
set firewall name WAN_LOCAL rule 30 log disable
set firewall name WAN_LOCAL rule 30 protocol udp
set firewall name WAN_LOCAL rule 40 action accept
set firewall name WAN_LOCAL rule 40 description esp
set firewall name WAN_LOCAL rule 40 log disable
set firewall name WAN_LOCAL rule 40 protocol esp
set firewall name WAN_LOCAL rule 50 action accept
set firewall name WAN_LOCAL rule 50 description nat-t
set firewall name WAN_LOCAL rule 50 destination port 4500
set firewall name WAN_LOCAL rule 50 log disable
set firewall name WAN_LOCAL rule 50 protocol udp
set firewall name WAN_LOCAL rule 60 action accept
set firewall name WAN_LOCAL rule 60 description l2tp
set firewall name WAN_LOCAL rule 60 destination port 1701
set firewall name WAN_LOCAL rule 60 ipsec match-ipsec
set firewall name WAN_LOCAL rule 60 log disable
set firewall name WAN_LOCAL rule 60 protocol udp
set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret
set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret examplepassphrase
set vpn l2tp remote-access authentication mode local
set vpn l2tp remote-access authentication local-users username exampleuser password examplepassword
set vpn l2tp remote-access client-ip-pool start 192.168.1.190
set vpn l2tp remote-access client-ip-pool stop 192.168.1.199
set vpn l2tp remote-access dns-servers server-1 192.168.1.1
set vpn l2tp remote-access dns-servers server-2 1.1.1.1
set vpn l2tp remote-access outside-address 0.0.0.0
set vpn ipsec ipsec-interfaces interface pppoe1
set vpn l2tp remote-access mtu 1392
The logging from sudo swanctl --log is:
11[NET] received packet: from 109.140.80.145[10415] to 77.109.124.40[500] (788 bytes)
11[ENC] parsed ID_PROT request 0 [ SA V V V V V V V V V V V V ]
11[IKE] received NAT-T (RFC 3947) vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike-08 vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike-07 vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike-06 vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike-05 vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike-04 vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike-03 vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike-02 vendor ID
11[IKE] received draft-ietf-ipsec-nat-t-ike-02\n vendor ID
11[IKE] received FRAGMENTATION vendor ID
11[IKE] received DPD vendor ID
11[IKE] 109.140.80.145 is initiating a Main Mode IKE_SA
11[ENC] generating ID_PROT response 0 [ SA V V V ]
11[NET] sending packet: from 77.109.124.40[500] to 109.140.80.145[10415] (136 bytes)
06[NET] received packet: from 109.140.80.145[10415] to 77.109.124.40[500] (380 bytes)
06[ENC] parsed ID_PROT request 0 [ KE No NAT-D NAT-D ]
06[IKE] remote host is behind NAT
06[ENC] generating ID_PROT response 0 [ KE No NAT-D NAT-D ]
06[NET] sending packet: from 77.109.124.40[500] to 109.140.80.145[10415] (396 bytes)
11[NET] received packet: from 109.140.80.145[10416] to 77.109.124.40[4500] (108 bytes)
11[ENC] parsed ID_PROT request 0 [ ID HASH N(INITIAL_CONTACT) ]
11[CFG] looking for pre-shared key peer configs matching 77.109.124.40...109.140.80.145[100.124.103.111]
11[CFG] selected peer config "remote-access"
11[IKE] IKE_SA remote-access[5] established between 77.109.124.40[78.23.248.159]...109.140.80.145[100.124.103.111]
11[ENC] generating ID_PROT response 0 [ ID HASH ]
11[NET] sending packet: from 77.109.124.40[4500] to 109.140.80.145[10416] (92 bytes)
12[NET] received packet: from 109.140.80.145[10416] to 77.109.124.40[4500] (332 bytes)
12[ENC] parsed QUICK_MODE request 2319968120 [ HASH SA No ID ID NAT-OA NAT-OA ]
12[IKE] received 3600s lifetime, configured 0s
12[ENC] generating QUICK_MODE response 2319968120 [ HASH SA No ID ID NAT-OA NAT-OA ]
12[NET] sending packet: from 77.109.124.40[4500] to 109.140.80.145[10416] (204 bytes)
14[NET] received packet: from 109.140.80.145[10416] to 77.109.124.40[4500] (76 bytes)
14[ENC] parsed QUICK_MODE request 2319968120 [ HASH ]
14[IKE] CHILD_SA remote-access{5} established with SPIs cf06366d_i 01d345cf_o and TS 77.109.124.40/32[udp/l2f] === 109.140.80.145/32[udp/59859]
.... waits ...
14[NET] received packet: from 109.140.80.145[10416] to 77.109.124.40[4500] (92 bytes)
14[ENC] parsed INFORMATIONAL_V1 request 5356482 [ HASH D ]
14[IKE] received DELETE for ESP CHILD_SA with SPI 01d345cf
14[IKE] closing CHILD_SA remote-access{5} with SPIs cf06366d_i (704 bytes) 01d345cf_o (245 bytes) and TS 77.109.124.40/32[udp/l2f] === 109.140.80.145/32[udp/59859]
12[NET] received packet: from 109.140.80.145[10416] to 77.109.124.40[4500] (108 bytes)
12[ENC] parsed INFORMATIONAL_V1 request 1999475317 [ HASH D ]
12[IKE] received DELETE for IKE_SA remote-access[5]
12[IKE] deleting IKE_SA remote-access[5] between 77.109.124.40[78.23.248.159]...109.140.80.145[100.124.103.111]
09[KNL] interface ppp1 deleted