Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    How to specify external port when adding rules with Easyrule

    Firewalling
    2
    2
    1156
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      liuting last edited by

      Hi!

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

      : easyrule
      usage:
      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 1.2.3.4

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

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

      Because I want to pass any source with source port 8080 direct to 192.168.1.101:80,
      I tried command:  'easyrule pass wan tcp any 192.168.1.101 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?

      Regards,
      Liuting</destination></protocol></interface></interface>

      1 Reply Last reply Reply Quote 0
      • jimp
        jimp Rebel Alliance Developer Netgate last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Products

        • Platform Overview
        • TNSR
        • pfSense Plus
        • Appliances

        Services

        • Training
        • Professional Services

        Support

        • Subscription Plans
        • Contact Support
        • Product Lifecycle
        • Documentation

        News

        • Media Coverage
        • Press
        • Events

        Resources

        • Blog
        • FAQ
        • Find a Partner
        • Resource Library
        • Security Information

        Company

        • About Us
        • Careers
        • Partners
        • Contact Us
        • Legal
        Our Mission

        We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

        Subscribe to our Newsletter

        Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

        © 2021 Rubicon Communications, LLC | Privacy Policy