Open ports only to specific IPs


I want to open some ports only to specific IPs. I've found it can be done into the field named "Source IP address", but this field only accepts one IP, and I want to put three IPs.

I've found than the field "Source MAC address" can have multiple values, but not for the IP field.

Does anybody know how to do so?



LuCI Network > Firewall > Traffic Rules > Rule > Edit

  • Source address > -- Add IP -- > -- custom -- > Space-separated IPs > Enter
  • ...

Save > Save & Apply

1 Like

There are multiple settings labeled "Source IP address"... (Which page are you using?)

I've tried to do so, but Luci says the IP is invalid. I've tried to separate IPs with colon or semi-colon, with no luck.

Network --> Firewall --> Port Forwards

Select the Port Forward rule and click on "Edit".

The 5th field on the new screen.

This is a known limitation for OpenWrt firewall redirects.
It should be possible to bypass with IP sets: