Open ports only to specific IPs

Hello,

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?

Regards,

Alex

1 Like

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 work around with IP sets:
https://openwrt.org/docs/guide-user/firewall/firewall_configuration?s=ipset#options2

Hello, I'm having the same issue as above. I have list of IPs. I've created list in /etc/firewall.user:

config  ipset
        option  name            'ssh_outside'
        option  match           'src_net'
        option  enabled         '1'
        list    entry           'xxx.yy.zz.cc.'
        list    entry           'xxx.yy.zz.cc.'

But how can I add this list on rules instead of 1 IP?
Do I need install a special package?
I have OpenWrt 19.07.
image

Thank you

could you post the output of

ubus call system board

1 Like

There's a chance it can work for you when configured with CLI:
https://openwrt.org/docs/guide-user/firewall/fw3_configurations/fw3_config_ipset

1 Like

ubus call system board

{
        "kernel": "4.14.133",
        "hostname": "OpenWrt",
        "system": "Qualcomm Atheros QCA956X ver 1 rev 0",
        "model": "TP-Link Archer C6 v2",
        "board_name": "tplink,archer-c6-v2",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07-SNAPSHOT",
                "revision": "r10255-96cc390d88",
                "target": "ath79/generic",
                "description": "OpenWrt 19.07-SNAPSHOT r10255-96cc390d88"
        }
}

I'm thinking to upgrade to the newest version.

Upgrading to the newst version solved the problem. Thank you.

1 Like