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

    Problem with static routes/gateway on another subnet

    Scheduled Pinned Locked Moved General pfSense Questions
    2 Posts 2 Posters 1.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.
    • D
      dunks
      last edited by

      Hey guys,

      I'm currently having some issues with the way my dedicated server host manages extra IPs.

      I'm running it under ESXi, the host has the address 62.210.207.24, with a gateway of 62.210.207.1 .

      My WAN interface, em0, has the address 212.83.147.38. My gateway however must be set as 62.210.207.1

      In order to do this I have a route set up like this:

      route add -net 62.210.207.1/32 -iface em0
      route add default 62.210.207.1

      This works, but however once I restart my pfsense machine the routes no longer exist. I've tried adding them using the web interface but it doesn't seem to work, nor with adding it to the config.xml with shellcmd.

      Any ideas how I can have these routes/gateways set upon boot?

      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • R
        renow
        last edited by

        Hi,

        based on Online documentation, you have to change netmask to /32 too…

        To have all theses settings saved on reboot, you will have to change the /conf/config.xml file of your pfsense VM.
        You can change the netmask in the interface definition :<interfaces><wan></wan></interfaces>

        You have to add the two following lines just before

        <shellcmd>route add -net 62.210.207.1/32 -iface em0</shellcmd>
        <shellcmd>route add default 62.210.207.1</shellcmd>
        

        Hope this helps…

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