firewall: port forward with ipset
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.9k
- Forks
- 2.9k
- Avg merge
- 4d 17h
- Merged PRs (30d)
- 28
Description
Is there an existing issue for this?
- I have searched the existing issues
screenshots or captures
No response
Actual behaviour
Hi!
I have defined an ipset with match type src_ip. I added some entries (source IP-s) to it. I defined a port forward for my local server using the previously defined ipset. I click Save & Apply and all works as expected.
When I add a new IP to the ipset and click Save & Apply, than I can reach the server from the new IP too. But, when I delete some IP-s (even just one) from the ipset and click Save & Apply, the server can be reached from the deleted source IPs until I manually restart the firewall. The main problem with this for me, that I need (automatically by a script) to modify this ipset over JSON RPC.
Expected behaviour
When I modify my ipset entries and click Save & Apply, than from the deleted source IPs should not reach the server.
Steps to reproduce
- Go to Network->Firewall->IP Sets
- Click Add
- Set a Name for it, change the Packet Field Match to src_ip: Source IP, add some IPs to the ipset
- Save it
- Go to Network->Firewall->Port Forwards
- Click Add
- Set a Name for it, set the External port, set the Internal IP address, the Internal port and on the Advanced settings tab set the previously saved ipset
- Click Save & Apply
- Now you can reach on the External port your internal device from the defined IP addresses
- Go to Network->Firewall->IP Sets
- Click edit at the previously defined IP set
- Delete some IP from it, and when you want, you can add a new one to it
- Click Save & Apply
- You can still reach the internal device on the external port from the deleted IP address
Additional Information
NAME="OpenWrt"
VERSION="23.05.5"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 23.05.5"
VERSION_ID="23.05.5"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r24106-10cc5fcd00"
OPENWRT_BOARD="ramips/mt7621"
OPENWRT_ARCH="mipsel_24kc"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 23.05.5 r24106-10cc5fcd00"
But the same happens on 24.10.0-rc2.
What browsers do you see the problem on?
No response
Relevant log output
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue through Network→Firewall→IP Sets and Port Forwards on the affected OpenWrt versions, then trace the LuCI Save & Apply and JSON RPC handling for ipset changes. Done means deleted source IPs can no longer reach the forwarded internal device after applying changes, while newly added IPs continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100