How to specify external port when adding rules with Easyrule

  • Hi!

    I am trying to add port forwarding using Easyrule. I've followed this in the shell:

    : easyrule
    Blocking only requires an IP to block
        easyrule block <interface><source ip="">

    Passing requires more detail, as it must be as specific as possible. The destination port is optional if you're using a protocol without a port (e.g. ICMP, OSPF, etc).
        easyrule pass <interface><protocol><source ip=""> <destination ip=""> [destination port]

    Block example:
        easyrule block wan

    Pass example (protocol with port):
        easyrule pass wan tcp 80

    Block example (protocol without port):
        easyrule pass wan icmp

    Because I want to pass any source with source port 8080 direct to,
    I tried command:  'easyrule pass wan tcp any 80' and it works, but I don't know how to add '8080' as a source port using Easyrule..
    Just like in web UI - Add a new rule - Source - Advanced,  I can specify the source port range.

    Does anyone know how to do this using Easyrule? or any other approach in the shell?


  • Rebel Alliance Developer Netgate

    There isn't a way to specify the source port with easyrule. It's rarely needed since most things randomize the source port.

    You can always hack at the source of the easyrule script and make your own to do whatever you want though.

Log in to reply