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

Creating Spamfilter BWL

I have recently moved from a FGT100A to a FGT60D. I am now trying to create (recreate) the BWL that I had from the old Fortigate. I can add entries through the GUI and/or individual CLI commands but I would prefer to do a bulk upload of CLI commands or at a next to last resort upload a config file with the list in it. When I try to do a bulk upload I get a configuration error and When I tried to upload a modified configuration file with the Spamfilter BWL added to it, nothing changed. I copied the general format of the Spamfilter config section, adding and changing entries where needed. The syntax should be correct. Where should I look for information on uploading bulk CLI commands? The CLI manual doesn' t seem to cover how to do this or what the upload file should look like.
4 REPLIES 4
ede_pfau
SuperUser
SuperUser

A batch command file is nothing special, just the command like you would type them in the CLI. To debug bulk command upload, open a SSH (or console) command window and issue
 diag deb ena
 diag deb cli 7
While uploading your file the commands will be echoed together with responses in the console window. To revert to default,
 diag deb dis
 diag deb cli 3
Alternatively, you could copy and paste single command lines from the bulk file into the console/SSH client.
Ede Kernel panic: Aiee, killing interrupt handler!
Ede Kernel panic: Aiee, killing interrupt handler!
rwpatterson
Valued Contributor III

I have seen too many commands in the GUI console slow things down. (even hung that window once or twice) SSH was fine.

Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com

Bob - self proclaimed posting junkie!See my Fortigate related scripts at: http://fortigate.camerabob.com
Ugadata
New Contributor

OK, all is right with the world again. Thanks to all for the quick responses. Using the console to debug the bulk as well as copy and paste individual commands showed me what was wrong. I was trying to copy and paste commands earlier but I didn' t have the external command input box enabled. What I did wrong, first I should know better than to think the syntax is correct when I have problems. The correct format for email is: edit 12 set type email set action clear set email-pattern " [email pattern]" next I had 3 things wrong. Everything needed to be in lower case. on some entries the " E" in edit and the " N" in next were capitalized. The last issue was " email pattern" should be " email-pattern" (appearently the dash matters ) Worked fine after cleaning up the typos.
ede_pfau
SuperUser
SuperUser

You' re welcome, glad it works now for you. The CLI is a *nix shell and as such case sensitive. Actually, in 10 years experience with Fortinet I' ve never tried writing " end" as " End" and so it didn' t occur to me that one could fail here. Guess I' m taking too much for granted... Some more hints for working with the CLI: 1. Typing a ' ?' at any point within a command will show all possible continuations. For example, withing ' conf sys glo' , type ' set ?' to see all options which can be set. Or just type ' ?' to see all available actions (set/unset/get/show/abort/end). 2. You only have to enter the beginning of a command long enough to make it unambiguous (' exe bac c u gate.conf' to backup the config to USB stick). 3. command line continuation key is the Tab key. 4. You have 3 types of console window: - the serial console - the js widget on the Dashboard - a SSH console window Of these, the serial console is special in that it sometimes shows hardware error messages that are not displayed in the others. And, of course, boot messages. Enjoy!
Ede Kernel panic: Aiee, killing interrupt handler!
Ede Kernel panic: Aiee, killing interrupt handler!
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