Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration error when using script wrapper #159

Open
XobrekX opened this issue Jan 8, 2025 · 0 comments
Open

Configuration error when using script wrapper #159

XobrekX opened this issue Jan 8, 2025 · 0 comments
Labels
bug/possible A possible bug that has not yet been confirmed

Comments

@XobrekX
Copy link

XobrekX commented Jan 8, 2025

Package version

1.0.20220627

Firmware version

v2.0.9-hotfix.7

Device

EdgeRouter X (SFP, 10 X, EP-R6) - e50

Issue description

When using the following script, I get the error below. Has anybody an idea what I might be doing wrong?
Thank you! Everything else seems to work fine.

Script:

#!/bin/vbash

export vyatta_bindir=/opt/vyatta/bin
export vyatta_sbindir=/opt/vyatta/sbin
export vyatta_configdir=/opt/vyatta/config

source /opt/vyatta/etc/functions/script-template

configure
set interfaces wireguard wg0 private-key /config/wireguard/server_keys/private.key
set interfaces wireguard wg0 address <ip>/24
set interfaces wireguard wg0 route-allowed-ips true
set interfaces wireguard wg0 listen-port 51820
set interfaces wireguard wg0 firewall in name WG_IN
set interfaces wireguard wg0 firewall local name WG_LOCAL

commit

Output:

user@edgerouter:~$ ./script.sh
The specified configuration node already exists
The specified configuration node already exists
The specified configuration node already exists
The specified configuration node already exists
The specified configuration node already exists
The specified configuration node already exists
[ interfaces wireguard wg0 firewall in name WG_IN ]
Firewall config error: Rule set WG_IN is not configured

Commit failed

I also tried using the vyatta-cfg-cmd-wrapper in the following script:

#!/bin/vbash

export vyatta_bindir=/opt/vyatta/bin
export vyatta_sbindir=/opt/vyatta/sbin
export vyatta_configdir=/opt/vyatta/config

RUN=/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper

$RUN begin

$RUN set interfaces wireguard wg0 private-key /config/wireguard/server_keys/private.key
$RUN set interfaces wireguard wg0 address <ip>/24
$RUN set interfaces wireguard wg0 route-allowed-ips true
$RUN set interfaces wireguard wg0 listen-port 51820

#$RUN set interfaces wireguard wg0 firewall in name WG_IN
#$RUN set interfaces wireguard wg0 firewall local name WG_LOCAL

$RUN commit

Resulting in the following:

[ interfaces wireguard wg0 ]
This script must be executed from vyatta configuration system.

Commit failed

The second way to go used to work with every other config in my EdgeRouter, the only missing part is the wireguard firewall.
I really appreciate any hint!

Thank you very much!

Configuration and log output

No response

@XobrekX XobrekX added the bug/possible A possible bug that has not yet been confirmed label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/possible A possible bug that has not yet been confirmed
Development

No branches or pull requests

1 participant