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

Port forward: ipset not updated when editing source IP list in port forward #896

Open
gsanchietti opened this issue Nov 11, 2024 · 2 comments
Labels
verified All test cases were verified successfully

Comments

@gsanchietti
Copy link
Member

Title:
Steps to reproduce

  1. Manually enter a list of allowed source IPs in a port forward (without using host set or host domain).
  2. Remove an IP from the list or modify an existing one.

Expected behavior

  • The IP set should be updated, reflecting the change in the firewall rules.

Actual behavior

  • The IP set is not updated: the port forward still works for the removed IP.
  • The IP is removed from UCI, but the change does not reflect in nft.

Workaround

Execute:

fw4 restart

Please note that a reload is not enough

Components
NethSecurity version: 8-23.05.5-ns.1.3.0

@gsanchietti gsanchietti added this to the NethSecurity 8.4 milestone Nov 11, 2024
@Tbaile Tbaile self-assigned this Nov 12, 2024
@Tbaile Tbaile moved this from ToDo 🕐 to In Progress 🛠 in NethSecurity Nov 12, 2024
@Tbaile
Copy link
Contributor

Tbaile commented Nov 12, 2024

QA:

  1. install the image 23.05.5-ns.1.3.0-33-gef914db
  2. create a port forward with a list of source ips
  3. commit changes
  4. open terminal and with nft find the ipset (nft list set inet fw4 <setname>)
  5. edit the port forward and commit changes
  6. from the terminal, check again with nft that the record is changed.

@Tbaile Tbaile moved this from In Progress 🛠 to Testing in NethSecurity Nov 12, 2024
@Tbaile Tbaile added the testing Packages are available from testing repositories label Nov 12, 2024
@Tbaile Tbaile assigned cotosso, francio87 and mamengoni and unassigned Tbaile Nov 12, 2024
@francio87
Copy link
Member

Confirm fixed ✅

Image

root@NethSec:~# nft list set inet fw4 ns_cd1c7c25_ipset
table inet fw4 {
        set ns_cd1c7c25_ipset {
                type ipv4_addr
                flags interval
                auto-merge
                elements = { 8.8.8.8, 80.17.99.73-80.17.99.75 }
        }
}

removed the ip 80.17.99.74 and save:

root@NethSec:~# uci changes
-firewall.ns_cd1c7c25_ipset
firewall.ns_cd1c7c25_ipset='ipset'
firewall.ns_cd1c7c25_ipset.name='ns_cd1c7c25_ipset'
firewall.ns_cd1c7c25_ipset.match='src_net'
firewall.ns_cd1c7c25_ipset.enabled='1'
firewall.ns_cd1c7c25_ipset.ns_link='firewall/ns_cd1c7c25'
firewall.ns_cd1c7c25_ipset.entry+='80.17.99.73'
firewall.ns_cd1c7c25_ipset.entry+='80.17.99.75'
firewall.ns_cd1c7c25_ipset.entry+='8.8.8.8/32'
-firewall.ns_cd1c7c25.proto
firewall.ns_cd1c7c25.proto+='tcp'
firewall.ns_cd1c7c25.proto+='udp'

the ipset has been updated correctly.

root@NethSec:~# nft list set inet fw4 ns_cd1c7c25_ipset
table inet fw4 {
        set ns_cd1c7c25_ipset {
                type ipv4_addr
                flags interval
                auto-merge
                elements = { 8.8.8.8, 80.17.99.73,
                             80.17.99.75 }
        }
}

@francio87 francio87 added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Nov 13, 2024
@francio87 francio87 removed their assignment Nov 13, 2024
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

5 participants