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

    Static routing to an interface

    Scheduled Pinned Locked Moved Routing and Multi WAN
    7 Posts 3 Posters 2.0k 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.
    • T
      traxanos
      last edited by

      Hi,

      how i can create a static route to an interface. We have a broadcast subnet and on this interface many private and public ip addresses. those ips are directly on this interface reachable without gateway.

      greets

      1 Reply Last reply Reply Quote 0
      • T
        traxanos
        last edited by

        The command is:

        route add -net NETWORK/NETMASK -iface INTERFACE

        Is there everythere a configuration mask. Or where i can add the lines for boot up.

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

          We don't have a way to do that in the GUI at the moment (See http://redmine.pfsense.org/issues/972 )

          You could use the shellcmd package to setup a startup command.

          Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • K
            kathampy
            last edited by

            Pardon my ignorance but how can you route to a subnet on an interface without the router having an address in that subnet on that interface? And how can you add a gateway that's not in the same subnet as the interface address? You can bridge them, but how would routing work?

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

              @KurianOfBorg:

              Pardon my ignorance but how can you route to a subnet on an interface without the router having an address in that subnet on that interface? And how can you add a gateway that's not in the same subnet as the interface address? You can bridge them, but how would routing work?

              By placing a route on the interface, it will do an ARP request to find the subnet there without having an IP in the same subnet. Sure, it's ugly, but it can work.

              Expect more ugliness as IPv4 space gets more and more scarce. Already some datacenters and providers are doing this (gateway in a subnet outside of where your IP resides)

              Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • K
                kathampy
                last edited by

                But what about the return path? Do the device it's talking to also need to support it?

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

                  Yep. They'd each need to know the other subnets are reachable via that same interface.

                  Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

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