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

    Is there a way to add many static routes

    Scheduled Pinned Locked Moved Routing and Multi WAN
    3 Posts 3 Posters 390 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.
    • H
      hsv
      last edited by hsv

      Hi
      I need to add about 100 static routes.
      I know how to do it through the GUI, but is it possible to edit a file or are the routes only included in th XML file.
      If so if XML is the only way, how to do it?

      kiokomanK johnpozJ 2 Replies Last reply Reply Quote 0
      • kiokomanK
        kiokoman LAYER 8 @hsv
        last edited by

        @hsv
        download a configuration backup (Diagnostic / Backup & Configuration)
        edit with notepad++
        search for staticroutes
        copy/paste respecting the syntax

        	<staticroutes>
        		<route>
        			<network>172.17.0.0/24</network>
        			<gateway>OPT3_VTIV4</gateway>
        			<descr><![CDATA[SRV]]></descr>
        		</route>
        		<route>
        			<network>192.168.10.0/24</network>
        			<gateway>OPT3_VTIV4</gateway>
        			<descr><![CDATA[LAN]]></descr>
        		</route>
        	</staticroutes>
        

        save as a new file,
        restore the configuration and reboot

        or use the GUI,
        afaik there is no other way

        ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
        Please do not use chat/PM to ask for help
        we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
        Don't forget to Upvote with the 👍 button for any post you find to be helpful.

        1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @hsv
          last edited by johnpoz

          @hsv said in Is there a way to add many static routes:

          I need to add about 100 static routes.

          Just my curiosity cat meowing at me - why? Can you not just summarize the routes?

          For example route to 192.168.0/24 and 192.168.1/24 could be routed as just 192.168.0/23

          If you have a lot of routes - I would try and summarize as much as possible.. Shoot you could sometimes route 100 with 1 statement, ie 192.168/16 for example..

          Or run a routing protocol? So the routes are exchanged?

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

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