OpenWrt Forum Archive

Topic: Firewall (many data in one rule)[SOLVED]

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi everyone!
Now i am try to set up firewall in openwrt!
I dont like use

config include
       option path '/etc/firewall.user'

So, i want set all my rules in /etc/config/firewall  (with CLI syntax)

Example i want add rules then i can connect to my router via SSH from two different ip
i am add

config rule
        option name 'Allow ssh admins'
        option src              'wan'
        option proto            'tcp'
        option dest_port        22
        option src_ip   '10.11.12.13'
        option target           'ACCEPT'

But how i can use this rule to all my ip or ports?
example i want allow ssh from 10.11.12.13,  247.5.23.34, 172.16.5.99 ?
and how i can set more that one port? 22, 80, 443 ?

So, in ideal i want add something like this:

config rule
        option name 'Allow ssh admins'
        option src              'wan'
        option proto            'tcp'
        option dest_port        '22, 80'
        option src_ip   '10.11.12.13 217.34.56.78 5.199.170.112'
        option target           'ACCEPT'

(Last edited by kobzar on 16 Oct 2013, 12:58)

as i undestand (thank to irc channel)
on OpenWrt Attitude Adjustment 12.09 i can use only multiple port. multiple IP is not work
example
     option dest_port '123 456 789 22 53' etc. to specify multiple ports

Thanks to all !

A bit late but: useful thanks! Let's include it in the wiki!

The discussion might have continued from here.