Requirement
|
Even in the era of zero touch configuration where everything can be modelled by YANG and automated by Ansible, CLI configuration mode is essential and will take a special important place into network engineers' heart.
Any network engineer in the room who never issued this command ?
conf t ... |
In this article, we will present you freeRouter available configuration mode. This is an essential article as it will help you in your potential daily operation task.
When you log into a network equipment such as a router, you tend to have some automatic reflex. You usually:
Let's assume you want to configure interface sdn3 description:
As you would notice, configuring these from "config terminal" prompt has an immediate effect. Please note you can issue "show" command from config mode using the "do" keyword :
At that point you have a running-config in router memory and you have a startup-config written into the freeRouter flash. In order to see the difference:
Notice the use of "end" primitive in order to end configuration mode and revert to user mode. In the example we used shortcut command name:
So basically this command will show you the difference between running-config and startup-config. This is similar to Junos: show | compare except that in this context this a comparison between running and startup config. In this case it just delete the current description and replace it by the new one. Once you are happy you can write the running-config into the startup-config:
You observe that show config-differences has no relevant output. running-config is aligned to startup-config !
|
"configure viewer" is a very interesting mode as it gives you the possibility to review the router configuration from a viewer inspired from "mcedit" (Norton Midnight Commander)
Then you'll be able to read your configuration from a READ-ONLY text buffer: As a side note, you can benefit from online help by pressing <f1> But what if I just want to view a specific object ? Let's find out how to check ONLY BGP configuration @ home:
So in this case It'll just throw my IPv4 bgp config snippet onto the viewer buffer Same if I want to only view all interface sdn<x> from the router config:
This is so cool, isn't ?
|
"configure viewer" gives you the possibility to view the config or some parts of the config in read-only mode. "configure editor" gives you simply the possibility to edit also the specific running-config config stanza.
Then you'll be able to edit your configuration from a READ-WRITE text buffer: As a side note, you can benefit from online help by pressing <f1> You can press Ctrl+q in order to exit the editor. As you did not change anything it will exit the editor. But what if I just want to edit a specific object ? Let's find out how to check ONLY BGP configuration @ home:
So in this case I'll just throw my IPv4 bgp config onto the editor buffer In this buffer let's just create a description for BGP neighbor 172.23.215.177. Now just press Ctrl-q (as per the online help accessible using <f1>). However, freeRouter detect the buffer changed has we added BGP description configuration. Therefore it will ask you if you want to save the buffer change into the running-config and apply it. At that moment you'll be displayed a small recap of what has been applied. Even more cool no ?
|
Same as "config editor", but instead of working against the running-config you are editing the startup-config. Which is more safe ... till the next reload
|
"configure reload" as its name implies is not about reloading a router whatsoever
This command take a <url> as argument. Basically it will fetch router configuration from the specified <url> and load it into the startup-config. It is an equivalent to Cisco "copy <url> start". From that point:
|
"configure network" gives you the possibility to update/merge existing running-config from config exposed from a web server.
This command take a <url> as argument. Basically it will fetch specified configuration from the specified <url> and merge it into the running-config. It is an equivalent to Cisco "copy <url> run". So, from that point:
|
Same as "configure network" gives you the possibility to replace running-config from config exposed from a web server.
This command take a <url> as argument. Basically it will fetch specified configuration from the specified <url> and replace the running-config. It is an equivalent to Cisco "copy <url> run". So, from that point:
|
"configure banner" is one of my favorite mode. It will display an editor allowing you to edit the banner of your router.
Press Ctrl-q and then y in order to save the banner. Log in to you router again in order to check your new banner:
the command corresponds to the banner mentioned above. |
"configure revert" revert the running-config to the startup config. For Junos fan it is equivalent to "rollback 0"
|
"configure rollback" is very useful when you are in an operational situation that needs "trial and error" approach, and sometimes the error can lead to loss of connectivity on the router itself... Who never experienced that ? First of all we have a saying a French saying: "Il n'y a que ceux qui ne font rien qui ne font pas de bêtise". So don't feel guilty about that... I remembered having isolated some sites just by accident ... In this situation "configure rollback" is a combination of "configure revert" and a loss of CLI TCP session. What does this practically means ? Imagine you are configuring a redistribution between IS-IS and OSPF and that you forgot that the network have 2 connections. This redistribution without careful route filtering will result in a routing loop and it happens that you lose connectivity upon that configuration. (never ending routing advertisement loop, high cpu load etc...) Upon losing TCP connection, in "configure rollback" freeRouter will automatically revert to its startup config. You will therefore auto-magically get back connection before it was the route redistribution that caused the havoc. How cool is that !
|
"configure file" gives you to the possibility to update/merge running configuration from a local file from the flash filesystem.
This command take a <file> as argument. Basically it will load specified configuration from the specified <file> and update/merge the running-config. It is an equivalent to Cisco "copy <flash:file> run". So, from that point:
|
"configure file" gives you to the possibility to replace running configuration from a local file from the flash filesystem.
This command take a <file> as argument. Basically it will load specified configuration from the specified <file> and replace the running-config. It is an equivalent to Cisco "copy <flash:file> run". So, from that point:
|
Most of you will simply use the basic "conf t" mode, but keep in mind that depending on your context, all the other modes are proven to be very handy. The possibility to configure 1000 router with one single config file using "config network" is a savior. Having the possibility to trigger automatic definitive router staging using "conf reload" is tremendously useful when you have to deploy 10 routers a day. As said "config view" can give non operation staff to check if some configs are there or not ... "config editor" is very powerful when you want to edit a never ending access-list, but remember to avoid to use it for complex BGP config... You have been warned !
In this 1st article:
All these modes are not new. IOS, IOS-XR, IOX-XE, NW-OX, JUNOS have their own config mode that are somewhat similar. In any case freeRouter config mode implementation is meant to address all needs from the network operators perspective. As you can observe, configure mode has an impressive list of mode. Feel free to try and use them according to your environment taste! Last but not least, you can play with these different mode from this sandbox:
In order to exit the sandbox session use the following escape sequence: Ctrl-c + Ctrl-x Another method to access the sandbox, by click here, this will open a terminal webapp into your browser: |