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

    Redirect to a ip address

    Scheduled Pinned Locked Moved Firewalling
    5 Posts 3 Posters 2.1k Views
    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.
    • G
      guaripolo
      last edited by

      hi, i'm modifying my pfsense 1.2.3 just for fun (and learn). I want to redirect all the outgoing traffic of a single ip (i.e 10.0.0.100) to one ip address.
      I've seen some tutorials for freebsd using things like:

      ipfw add divert natd ip from any to any
      natd -interface en1 -target_address 255.255.255.255 -alias_address 173.203.210.155 -reverse

      but the first sentence throws an error like

      ipfw: getsockopt(IP_FW_ADD): Invalid argument

      I hope that someone here can help me to figure it out. Regards!

      1 Reply Last reply Reply Quote 0
      • D
        dhatz
        last edited by

        pfsense 1.2.3 is several years old. You should upgrade to the current version, which is 2.0.1

        You can do redirection from the pfsense WebGUI (BTW pfSense favors "pf" rather than "ipfw"). Anyway, if you want to transparently redirect all IP traffic (without nat'ting) from 10.0.0.100 to e.g. 10.1.0.1 using ipfw rather than pf, you could try something like:

        fwd 10.1.0.1 ip from 10.0.0.100 to any in

        1 Reply Last reply Reply Quote 0
        • G
          guaripolo
          last edited by

          ok, thanks! I will update to pfsense 2 soon, i was just too busy :)

          1 Reply Last reply Reply Quote 0
          • Cry HavokC
            Cry Havok
            last edited by

            Note that you should do everything via the web interface, not on the command line (at least until you fully understand the differences between pfSense and a standard FreeBSD install).

            1 Reply Last reply Reply Quote 0
            • G
              guaripolo
              last edited by

              @Cry:

              Note that you should do everything via the web interface, not on the command line (at least until you fully understand the differences between pfSense and a standard FreeBSD install).

              Well, that's why i'm doing this, just for fun and learning  ;D

              Now, another question related, i know that if i do:

              fwd 10.1.0.1 ip from 10.0.0.100 to any in

              this will redirect, but it will not change the header in the packets, so i can't redirect to a external website (i.e. google). In that case ¿did i need to use natd? ¿can i do it from the webgui? (i've tried with nat options but with no luck)

              Thanks for your answers!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.