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

Migration: openvpn device name lenght #1061

Open
francio87 opened this issue Feb 4, 2025 · 3 comments
Open

Migration: openvpn device name lenght #1061

francio87 opened this issue Feb 4, 2025 · 3 comments
Labels
verified All test cases were verified successfully

Comments

@francio87
Copy link
Member

While migrating OpenVPN tunnels, it has been observed that if the device name exceeds 16 characters, an error occurs in NFT. This issue prevents the proper startup of the service

Steps to reproduce

  • Migrate a firewall where the VPN tunnel name was tunnel-uffici

Expected behavior

The VPN tunnel should be active and functioning correctly after migration.

Actual behavior

The VPN tunnel is imported with its name properly truncated in the ns_name property, but the dev property of OpenVPN contains a device name that exceeds the maximum length of 16 characters.

root@ns-fwsede:~# uci show openvpn.ns_tunnel_.ns_name
openvpn.ns_tunnel_.ns_name='tunnel-uff'
root@ns-fwsede:~# uci show openvpn.ns_tunnel_.dev
openvpn.ns_tunnel_.dev='tuntunnel-uffici'

This leads to an error when nft attempts to apply the firewall rules:

/dev/stdin:83:11-28: Error: String exceeds maximum length of 16
                iifname "tuntunnel-uffici" jump input_openvpn comment "!fw4: Handle openvpn IPv4/IPv6 input traffic"
                        ^^^^^^^^^^^^^^^^^^

Components

NethSecurity version: 8-23.05.5-ns.1.4.1

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Testing image version: 8-23.05.5-ns.1.4.1-51-gcbbc735

@github-actions github-actions bot added the testing Packages are available from testing repositories label Feb 4, 2025
@gsanchietti
Copy link
Member

Test case
Check the issue is not reproducibile

@francio87 francio87 self-assigned this Feb 5, 2025
@francio87
Copy link
Member Author

Confirm Fixed, tested with release 23.05.5-ns.1.4.1-53-g3049dab

Nsec 7.9:

Image

Nsec 8:

Image

root@ns79:~# uci show openvpn.ns_tunnel_.ns_name
openvpn.ns_tunnel_.ns_name='tunnel-sed'

root@ns79:~# uci show openvpn.ns_tunnel_.dev
openvpn.ns_tunnel_.dev='tuntunnel-seder'

root@ns79:~# ip a sh tuntunnel-seder
11: tuntunnel-seder: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500
    link/none 
    inet 10.19.189.1/24 scope global tuntunnel-seder
       valid_lft forever preferred_lft forever
    inet6 fe80::c377:bb1d:490b:392b/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever

fw4 reload without issue :

root@ns79:~# fw4 reload
Section ns_user_include specifies unreachable path '/etc/firewall.user', ignoring section
Automatically including '/usr/share/nftables.d/chain-pre/input/20-don.nft'
Automatically including '/usr/share/nftables.d/chain-pre/srcnat/20netmap.nft'
Automatically including '/usr/share/nftables.d/chain-post/dstnat/20netmap.nft'

@francio87 francio87 added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Feb 6, 2025
@francio87 francio87 removed their assignment Feb 6, 2025
@nethbot nethbot moved this from ToDo 🕐 to Verified in NethSecurity Feb 6, 2025
@Tbaile Tbaile added this to the NethSecurity 8.5 milestone Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified All test cases were verified successfully
Projects
Status: Verified
Development

No branches or pull requests

3 participants