visucius
Goto Top

Edgerouter - "Commit failed"

Hallo in die Runde und Euch allen ein schönes WE,

ich komme hier gerade nicht weiter und evtl. habt Ihr ja ne schnelle Idee, was es mit dem Problem auf sich hat.

Gegeben sei:
EdgeRouter X SFP, aktuelles BS, gestern konfiguriert, mit mehren vLans hinter einem gebridgtem KabelModem. Das scheint auch alles so zu laufen, wie ich es mir vorstelle.


Problem:
Konfiguration von l2tp-VPN lässt sich nicht speichern und endet in der CLI mit
"Commit failed
Warning: you have uncommitted changes that will not be saved.

Saving configuration to '/config/config.boot'...
Done
[edit]"


Anleitung war z.B. die hier:
https://help.ui.com/hc/en-us/articles/204950294-EdgeRouter-L2TP-IPsec-VP ...
(entsprechend angepasst)

Dabei ist es egal, ob ich die Befehle einzeln, Zeile für Zeile "commite und save" oder on Block. Wenn ich übers Webinterface die Befehle "nachbauen" möchte, kommt ebenfalls ein Fehler beim Speichern.

Die anfänglichen Befehle für die Firewall hat er aber offenbar übernommen, zumindest sehe ich die im Webinterface. Die Konfiguration des ipsec authentication mode und dem preshared key klappt aber schon nicht mehr und auch die VPN-User kann ich nicht anlegen (weiter habe ich es nicht probiert).

Hat jemand ne Idee, woran das liegen könnte?!

Content-Key: 1156221741

Url: https://administrator.de/contentid/1156221741

Printed on: April 18, 2024 at 09:04 o'clock

Member: chgorges
chgorges Aug 14, 2021 at 18:57:52 (UTC)
Goto Top
Zitat von @Visucius:

Hallo in die Runde und Euch allen ein schönes WE,
Moin,
Hat jemand ne Idee, woran das liegen könnte?!
Ohne deine Config zu kennen natürlich nicht, aber irgendwo hast du einen Fehler, bzw. die Config aus der Anleitung nicht auf dich angepasst.
Als Tip: Nach jeder Zeile ein commit ; save
dann siehst du schnell, wo das Problem ist.

VG
Member: Pjordorf
Pjordorf Aug 14, 2021 at 19:24:48 (UTC)
Goto Top
Hallo,

Zitat von @Visucius:
Dabei ist es egal, ob ich die Befehle einzeln, Zeile für Zeile "commite und save" oder on Block.
Willst du uns sagen das du z.B. 50 Änderungen hast, und nach jeder Änderung jedes Commit zu einen Fehler führt oder nur wenn du nach den 50 Änderungenen einmal das Commit machst? Die korrekte Berechtigung stimmt bzw. hast du aber schon? Bei welcher Änderung knallt es denn?

Die anfänglichen Befehle für die Firewall hat er aber offenbar übernommen,
Die da wären? Und wobei knallt es?

Gruß,
Peter
Member: Visucius
Visucius Aug 15, 2021 updated at 06:24:11 (UTC)
Goto Top
An der Config solls nicht scheitern. Es gibt nur einen User, der Anfangs mit dem Wizard angelegt wurde face-wink

firewall {
    all-ping disable
    broadcast-ping disable
    ipv6-name WANv6_IN {
        default-action drop
        description "WAN inbound traffic forwarded to LAN"  
        enable-default-log
        rule 10 {
            action accept
            description "Allow established/related sessions"  
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            description "Drop invalid state"  
            state {
                invalid enable
            }
        }
    }
    ipv6-name WANv6_LOCAL {
        default-action drop
        description "WAN inbound traffic to the router"  
        enable-default-log
        rule 10 {
            action accept
            description "Allow established/related sessions"  
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            description "Drop invalid state"  
            state {
                invalid enable
            }
        }
        rule 30 {
            action accept
            description "Allow IPv6 icmp"  
            protocol ipv6-icmp
        }
        rule 40 {
            action accept
            description "allow dhcpv6"  
            destination {
                port 546
            }
            protocol udp
            source {
                port 547
            }
        }
    }
    ipv6-receive-redirects disable
    ipv6-src-route disable
    ip-src-route disable
    log-martians enable
    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 19 {
            action accept
            description ike
            destination {
                group {
                }
                port 500
            }
            log disable
            protocol udp
        }
        rule 20 {
            action accept
            description esp
            log disable
            protocol esp
            state {
                invalid enable
            }
        }
        rule 21 {
            action accept
            description nat-t
            destination {
                port 4500
            }
            log disable
            protocol udp
        }
        rule 22 {
            action accept
            description l2tp
            destination {
                port 1701
            }
            ipsec {
                match-ipsec
            }
            log disable
            protocol udp
        }
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
}
interfaces {
    ethernet eth0 {
        address dhcp
        description Vodafone
        duplex auto
        firewall {
            in {
                ipv6-name WANv6_IN
                name WAN_IN
            }
            local {
                ipv6-name WANv6_LOCAL
                name WAN_LOCAL
            }
        }
        poe {
            output off
        }
        speed auto
    }
    ethernet eth1 {
        description "Mikrotik (Trunk)"  
        duplex auto
        poe {
            output 24v
        }
        speed auto
    }
    ethernet eth2 {
        description "AP (Trunk)"  
        duplex auto
        poe {
            output off
        }
        speed auto
    }
    ethernet eth3 {
        description "DECT (22)"  
        duplex auto
        poe {
            output off
        }
        speed auto
    }
    ethernet eth4 {
        description Port4
        duplex auto
        poe {
            output off
        }
        speed auto
    }
    ethernet eth5 {
        description SFP
        duplex auto
        speed auto
    }
    loopback lo {
    }
    switch switch0 {
        address 10.98.0.1/24
        description Local
        mtu 1500
        switch-port {
            interface eth1 {
                vlan {
                    vid 1
                    vid 11
                    vid 22
                    vid 33
                    vid 44
                    vid 99
                }
            }
            interface eth2 {
                vlan {
                    vid 1
                    vid 11
                    vid 22
                    vid 33
                    vid 44
                    vid 99
                }
            }
            interface eth3 {
                vlan {
                    pvid 22
                }
            }
            interface eth4 {
            }
            vlan-aware enable
        }
        vif 11 {
            address 10.98.11.1/26
            description vlan11
            mtu 1500
        }
        vif 22 {
            address 10.98.22.1/26
            description vlan22
            mtu 1500
        }
        vif 33 {
            address 10.98.33.1/26
            description vlan33
            mtu 1500
        }
        vif 44 {
            address 10.98.44.1/26
            description vlan44
            mtu 1500
        }
        vif 99 {
            address 10.98.99.1/26
            description vlan99
            mtu 1500
        }
    }
}
service {
    dhcp-server {
        disabled false
        hostfile-update disable
        shared-network-name LAN {
            authoritative enable
            subnet 10.98.0.0/24 {
                default-router 10.98.0.1
                dns-server 10.98.0.1
                dns-server 9.9.9.9
                lease 86400
                start 10.98.0.10 {
                    stop 10.98.0.49
                }
                static-mapping MikroTik {
                    ip-address 10.98.0.254
                    mac-address 08:55:31:5e:00:7f
                }
            }
        }
        shared-network-name vlan11 {
            authoritative disable
            subnet 10.98.11.0/26 {
                default-router 10.98.11.1
                dns-server 10.98.11.1
                dns-server 9.9.9.9
                lease 86400
                start 10.98.11.10 {
                    stop 10.98.11.49
                }
            }
        }
        shared-network-name vlan22 {
            authoritative disable
            subnet 10.98.22.0/26 {
                default-router 10.98.22.1
                dns-server 10.98.22.1
                dns-server 9.9.9.9
                lease 86400
                start 10.98.22.10 {
                    stop 10.98.22.49
                }
                static-mapping BangOlufsen {
                    ip-address 10.98.22.3
                    mac-address 00:09:a7:04:55:04
                }
                static-mapping N510-IP-PRO {
                    ip-address 10.98.22.2
                    mac-address 7c:2f:80:e0:7a:9c
                }
            }
        }
        shared-network-name vlan33 {
            authoritative disable
            subnet 10.98.33.0/26 {
                default-router 10.98.33.1
                dns-server 10.98.33.1
                dns-server 9.9.9.9
                lease 86400
                start 10.98.33.10 {
                    stop 10.98.33.49
                }
                static-mapping BR8690cdw {
                    ip-address 10.98.33.4
                    mac-address b4:22:00:23:71:50
                }
                static-mapping GD-Base {
                    ip-address 10.98.33.6
                    mac-address 5c:85:7e:4a:d8:21
                }
                static-mapping NWA1123-AC-HD {
                    ip-address 10.98.33.3
                    mac-address 5c:6a:80:ed:97:5a
                }
                static-mapping VM1-MX300 {
                    ip-address 10.98.33.7
                    mac-address 52:54:00:d0:6c:14
                }
            }
        }
        shared-network-name vlan44 {
            authoritative disable
            subnet 10.98.44.0/26 {
                default-router 10.98.44.1
                dns-server 10.98.44.1
                dns-server 9.9.9.9
                lease 86400
                start 10.98.44.10 {
                    stop 10.98.44.49
                }
                static-mapping BR3550cdw {
                    ip-address 10.98.44.2
                    mac-address b4:22:00:0b:6b:bc
                }
            }
        }
        shared-network-name vlan99 {
            authoritative disable
            subnet 10.98.99.0/26 {
                default-router 10.98.99.1
                dns-server 10.98.99.1
                dns-server 9.9.9.9
                lease 86400
                start 10.98.99.10 {
                    stop 10.98.99.49
                }
            }
        }
        static-arp disable
        use-dnsmasq disable
    }
    dns {
        dynamic {
            interface eth0 {
                service dyndns {
                    host-name skr-buero.goip.de
                    login xxxxxxxxx
                    password xxxxxxxxx
                    server www.goip.de
                }
                web dyndns
            }
        }
        forwarding {
            cache-size 500
            listen-on switch0
            listen-on eth1
            listen-on eth2
            listen-on eth3
            listen-on switch0.11
            listen-on switch0.22
            listen-on switch0.33
            listen-on switch0.44
            listen-on switch0.99
        }
    }
    gui {
        http-port 80
        https-port 443
        older-ciphers enable
    }
    mdns {
        reflector
    }
    nat {
        rule 5010 {
            description "masquerade for WAN"  
            outbound-interface eth0
            type masquerade
        }
    }
    ssh {
        port 22
        protocol-version v2
    }
    ubnt-discover {
        disable
    }
    unms {
        disable
    }
}
system {
    analytics-handler {
        send-analytics-report false
    }
    crash-handler {
        send-crash-report false
    }
    host-name EdgeRouter
    login {
        user admin.ih {
            authentication {
                encrypted-password xxxxxxxxxxxxxxxxxxxxxxxxx
            }
            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 {
        }
    }
    offload {
        hwnat enable
        ipsec enable
    }
    syslog {
        global {
            facility all {
                level notice
            }
            facility protocols {
                level debug
            }
        }
    }
    time-zone Europe/Berlin
    traffic-analysis {
        dpi enable
        export enable
    }
}
traffic-control {
    smart-queue qos_Vodafone {
        download {
            ecn enable
            flows 1024
            fq-quantum 1514
            limit 10240
            rate 700mbit
        }
        upload {
            ecn enable
            flows 1024
            fq-quantum 1514
            limit 10240
            rate 50mbit
        }
        wan-interface eth0
    }
}


/* Warning: Do not remove the following line. */
/* === vyatta-config-version: "config-management@1:conntrack@1:cron@1:dhcp-relay@1:dhcp-server@4:firewall@5:ipsec@5:nat@3:qos@1:quagga@2:suspend@1:system@5:ubnt-l2tp@1:ubnt-pptp@1:ubnt-udapi-server@1:ubnt-unms@2:ubnt-util@1:vrrp@1:vyatta-netflow@1:webgui@1:webproxy@1:zone-policy@1" === */ 
/* Release version: v2.0.9-hotfix.2.5402463.210511.1317 */
Member: Visucius
Visucius Aug 15, 2021 updated at 06:22:09 (UTC)
Goto Top
@Pjordorf: Die folgenden scheint er übernommen zu haben

set firewall name WAN_LOCAL rule 19 action accept
set firewall name WAN_LOCAL rule 19 description ike
set firewall name WAN_LOCAL rule 19 destination port 500
set firewall name WAN_LOCAL rule 19 log disable
set firewall name WAN_LOCAL rule 19 protocol udp
set firewall name WAN_LOCAL rule 20 action accept
set firewall name WAN_LOCAL rule 20 description esp
set firewall name WAN_LOCAL rule 20 log disable
set firewall name WAN_LOCAL rule 20 protocol esp
set firewall name WAN_LOCAL rule 21 action accept
set firewall name WAN_LOCAL rule 21 description nat-t
set firewall name WAN_LOCAL rule 21 destination port 4500
set firewall name WAN_LOCAL rule 21 log disable
set firewall name WAN_LOCAL rule 21 protocol udp
set firewall name WAN_LOCAL rule 22 action accept
set firewall name WAN_LOCAL rule 22 description l2tp
set firewall name WAN_LOCAL rule 22 destination port 1701
set firewall name WAN_LOCAL rule 22 ipsec match-ipsec
set firewall name WAN_LOCAL rule 22 log disable
set firewall name WAN_LOCAL rule 22 protocol udp

@chgorges:
Einzelne Zeilen. Beispiel folgt:
admin.ih@EdgeRouter# set vpn l2tp remote-access ipsec-settings ike-lifetime 3600
[edit]
admin.ih@EdgeRouter# commit ; save
[ vpn ]
L2TP VPN configuration error: IPsec authentication mode not defined.

Commit failed
Warning: you have uncommitted changes that will not be saved.

Saving configuration to '/config/config.boot'...  
Done
[edit]

admin.ih@EdgeRouter# set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret
[edit]
admin.ih@EdgeRouter# set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret test
[edit]
admin.ih@EdgeRouter# commit ; save
[ vpn ]
L2TP VPN configuration error: Outside address not defined.

Commit failed
Warning: you have uncommitted changes that will not be saved.

Saving configuration to '/config/config.boot'...  
Done
[edit]

admin.ih@EdgeRouter# set vpn l2tp remote-access authentication mode local
The specified configuration node already exists
[edit]
admin.ih@EdgeRouter# set vpn l2tp remote-access authentication local-users username VPNTest password test
[edit]
admin.ih@EdgeRouter# commit ; save
[ vpn ]
L2TP VPN configuration error: Outside address not defined.

Commit failed
Warning: you have uncommitted changes that will not be saved.

Saving configuration to '/config/config.boot'...  
Done
[edit]

admin.ih@EdgeRouter# set vpn l2tp remote-access client-ip-pool start 10.98.100.10
[edit]
admin.ih@EdgeRouter# set vpn l2tp remote-access client-ip-pool stop 10.98.100.19
[edit]
admin.ih@EdgeRouter# commit ; save
[ vpn ]
L2TP VPN configuration error: IPsec authentication mode not defined.

Commit failed
Warning: you have uncommitted changes that will not be saved.

Saving configuration to '/config/config.boot'...  
Done
[edit]
Member: em-pie
em-pie Aug 15, 2021 at 08:32:20 (UTC)
Goto Top
Moin,

kenne den EdgeRouter nicht, aber den Fehlermeldungen nach zu Urteilen müsstest du IMHO "in einem Rutsch" folgendes konfigurieren:
  • IP-Address-Pool für den VPN-Zugriff (hast du ja im letzten Code-Schnipsel umgesetzt), sowie
  • den VPN Authetifizierungsmodus (hast du im zweiten Code-Auszug realisiert).

Mache mal beides zusammen. Vermutlich geht das nicht in einzelnen Schritten

Gruß
em-pie
Member: HanTrio
HanTrio Aug 15, 2021 at 09:21:49 (UTC)
Goto Top
Bzgl. dieses Fehlers:
Outside address not defined.

In dem von dir verlinkten Tutorial taucht dieses command weiter unten auf ("Full CLI configuration"):
set vpn l2tp remote-access outside-address <address>
(so ziemlich am Ende)
-> da sollte vmtl. deine externe IP rein (?) dieses Command sehe ich nicht bei dir.

Für den Fall dynamischer IPs (ich hab in deiner Config auch etwas von dyndns gesehen?):
Das Problem wird hier erwähnt:
https://community.ui.com/questions/L2TP-VPN-configuration-error-The-spec ...
-> "For the vpn server to work, it needs an outside IP address to listen on"

Ein Lösungsvorschlag befindet sich hier:
https://community.ui.com/questions/Help-configuring-L2PT-VPN-for-pppoe-d ...
(ab Post 5)

Dort wird ein Script vorgestellt, welches - kontinuierlich per Cronjob - die "current IP" des pppoe-Interface ausliest und diesen Wert dann bei Bedarf in die "configured IP" einsetzt, falls diese unterschiedlich sind.

Evtl hilft das?
Member: Visucius
Visucius Aug 15, 2021 updated at 15:14:01 (UTC)
Goto Top
@em-pie:
Klappt auch nicht. Dazu habe ich auch - das habe ich auch erst in diesem Kontext realisiert - einen DHCP mit diesem Pool über das Webinterface angelegt. Falls "outside-address" ein Hinweis auf den DHCP sein könnte.

@HanTrio:
Ok, das lese ich mir mal durch. Wenn ich aber sehe, dass dieser "Bug" 6 Jahre, das Skript 8 Jahre alt ist und ich das dann noch bei jedem Update rekapitulieren muss?! Danke auf jeden Fall für Deine Mühe. Auf die Idee den Fehler bei Google zu "hinterfragen" hätte ich wahrlich auch selbst mal kommen können face-wink

Wenn das nix wird, lagere ich das Thema auf ne Docker-Installation aus. Portfreigabe und Routing wird der Edge ja hoffentlich unfallfrei hinbekommen 😤

PS: Was mir aber gerade in der Anleitung auffällt. Unter Full CLI configuration gibt es ne Zeile: "set vpn ipsec ipsec-interfaces interface <id>" ... die gibt es oben bei den einzelnen Schritten nicht.

PPS: Und eth0 (meinen WAN-Port) nimmt er nicht
Member: chgorges
chgorges Aug 15, 2021 at 17:53:23 (UTC)
Goto Top
Oder alternativ OpenVPN benutzen, hab zig ER-X mit C2S und S2S am Laufen, die sind da Bockstabil.
Vor allem kannst du bei OpenVPN eine DynDNS-Adresse als Local-Host eintragen und brauchst nicht zwingend eine IP.
Member: Visucius
Visucius Aug 16, 2021 at 09:28:04 (UTC)
Goto Top
Die "Idee" mit L2tp ist eigentlich entstanden, weil die (Windows-)Clients das ohne Extra-Software connecten können.

Wenn ich auf den Clients eh was installieren muss, würde ich vermutlich gleich zu Wireguard greifen. Die Connection zwischen zwei Standorten soll dann eh darüber laufen.

Na, mal sehen, was es dann wird. Mit L2TP auf dem Edge bin ich jetzt erstmla nicht weitergekommen. Auch wenn ich sonst das Gerät eigentlich nicht so übel finde.
Member: mbehrens
Solution mbehrens Aug 16, 2021 at 15:06:35 (UTC)
Goto Top
Fehlt da nicht ein

set vpn l2tp remote-access dhcp-interface eth0
Member: Visucius
Visucius Aug 17, 2021 updated at 14:58:12 (UTC)
Goto Top
@mbehrens: DANKE DIR!

Funktioniert zwar (noch) nicht ... aber der Hinweis hat mich schon mal bis zum Speichern der Konfiguration gebracht face-wink

Falls mal jemand das gleiche Problem hat:

Der Befehl "set vpn l2tp remote-access dhcp-interface eth0" bringt einen bei Google z.B. zu https://support.pilotfiber.com/ubiquiti/setup-l2tp-server-edgemax-router ...

Gegenüber der Originalanleitung, kommt nicht nur der oben genannte Befehl dazu, sondern der preshared-secret steht auch in "Apostroph".

Allerdings fehlt der Befehl: "set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret" (aus der Orginalanleitung). Mit beidem zusammen lässt sich die Config anstandslos speichern face-wink

Aktuell antwortet der Server (zumindest von innen) noch nicht. Mal sehen ob das von extern besser geht face-wink
Member: mbehrens
mbehrens Aug 17, 2021 at 15:03:42 (UTC)
Goto Top
Zitat von @Visucius:

Falls mal jemand das gleiche Problem hat:

Der Befehl "set vpn l2tp remote-access dhcp-interface eth0" bringt einen bei Google z.B. zu https://support.pilotfiber.com/ubiquiti/setup-l2tp-server-edgemax-router ...

Gegenüber der Originalanleitung, kommt nicht nur der oben genannte Befehl dazu, sondern der preshared-secret steht auch in "Apostroph".

Nochmal nachgeschaut, der Befehlt steht auch in der Originalanleitung.
Member: Visucius
Visucius Aug 17, 2021 at 15:25:17 (UTC)
Goto Top
Nochmal nachgeschaut, der Befehlt steht auch in der Originalanleitung.

Jo, Tomaten sind was feines ... nur nicht auf den Augen face-wink
Member: Visucius
Visucius Aug 18, 2021 at 14:32:15 (UTC)
Goto Top
Kurzes Feedback: In der richtigen Richtung habe ich gestern 40 Mbit gemessen 😆. Da ging dann aber auch die CPU vom Edge auf knapp 50%.

Danke für Eure Hilfe!
Member: chgorges
chgorges Aug 24, 2021 at 15:36:06 (UTC)
Goto Top
Du kannst das Hardware Offloading noch anschalten, dann merkt die CPU nicht mehr wirklich was face-smile