Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
HzE
New Contributor

Config backup with Rancid?

Hi, I' m wondering if you' re able to make backups of your Fortigate configuration with Rancid? They have already released some corrections but I' m still not able to make backups. Initially the problem was that Fortigate has different kind of prompt depending of the operating mode (readonly etc.). This was fixed with a patch in 2.3.2 and is included in the release after that. One problem what is still active is that if VDOM' s are used, you cannot read configuration with the command " show full-configuration" . Rather you first need to go to global configuration. I tired to modify the script and in some extend it works but Rancid tells that it did not find the end of the configuration. The script also tries to switch off paging of commands with: config system console set output standard This is also wrong since with VDOM' s you first need to go to global config before doing that. Also it is not possible when using a readonly account which I would prefer in case of Rancid.
3 REPLIES 3
FLSSRC
New Contributor

HzE, have you come up with a solution for this? I have the same issue.
FLSSRC
New Contributor

I have been working with this same issue. I have the problem partly fixed. I modified the fnrancid file as follows: # Main @commandtable = ( {' config global' => ' GetSystem' }, {' get system status' => ' GetSystem' }, {' show full-configuration' => ' GetConf' } Note where I added {' config global' => ' GetSystem' }. This actually works pretty well. I now get an incomplete config. I think the problem is that there is either a bug in the show full-configurion command, or I don' t understand what it is supposed to do. I would be under the impression that a command that says " show full-configuration" would show you the full configuration. When I compare a configuration taken using this process with a backup configuration however, I find that I am wrong. The show full-configuaration is incomplete. It is missing a great deal of the vdom configuration that is normally located at the begining of a backup config and it is missing all of the config vdom information located in the backup after the config antivirus. You will be unable to use this to restore any of your vdom information If anyone can find a better way to back up a fortigate with a vdom using RANCID, pleas let me know. Fortinet, can you fix the show full-configuration command when run on a machine that is configured with vdoms so that it shows the full configuration? Otherwise, maybe you should get rid of this command so people will not be confused about what it really does. Thanks
FLSSRC
New Contributor

Ok, I think I have come up with a solution for this. It is pretty convoluted, but given the way a fortigate with vdoms works, it is the only way I could get it to work. Here is how I did it: 1. you must configure RANCID to back up each VDOM separately. This needs to include the root vdom. You must also back up config global. to do this, I created separate RANCID device type configurations for each VDOM and in the #Main section added the following: # Main @commandtable = ( {' config vdom' => ' GetSystem' }, {' edit root' => ' GetSystem' }, {' get system status' => ' GetSystem' }, {' show full-configuration' => ' GetConf' } ); Note that for my other vdoms, I created RANCID device types replacing root with the name of each vdom. So, since I have 2 vdoms, I had to create 4 separate RANCID device types, one for global, one for root, and one for each of my VDOMs. I used the fnrancid device type as the template for each of these. Note that after creating all of these, you must edit the rancid-fe file to include them. 2. I configured RANCID to back up each of these separately. This gives me 4 backups for my device (since I have 2 vdoms). 3. to restore, I have to combine all 4 backups following these steps: 1. Create a new file with the following commands to the top of the file: config vdom edit root end config vdom edit vdom1 end config vdom edit vdom2 end config global 2. Paste the output of the global backup next. 3. Paste the following commands into the file after the output of global: end config vdom edit root 4. Paste the output of the root backup next. 5. Paste the following commands into the file after the output of root: end config vdom edit vdom1 6. Paste the output of the vdom1 backup next. 7. Paste the following commands into the file after the output of vdom1: end config vdom edit vdom2 8. Paste the output of the vdom2 backup next. 9. Paste the following commands into the file after the output of vdom2: end end 10. Save this newly created text document and restore it to the firewall and you should be good to go. If anyone can come up with a better way to do this, please let me konw.
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors