D-Link DFL-260-IPS-12 Product Manual - Page 44
Tip: Listing commands at the console, Creating Scripts Automatically, Commenting Script Files
View all D-Link DFL-260-IPS-12 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 44 highlights
2.1.5. CLI Scripts Chapter 2. Management and Maintenance gw-world:/> script -show -name=my_script.sgs Creating Scripts Automatically When the same configuration objects needs to be copied between multiple NetDefend Firewalls, then one way to do this with the CLI is to create a script file that creates the required objects and then upload to and run the same script on each device. If we already have a NetDefendOS installation that already has the objects configured that need to be copied, then running the script -create command on that installation provides a way to automatically create the required script file. This script file can then be downloaded to the local management workstation and then uploaded to and executed on other NetDefend Firewalls to duplicate the objects. For example, suppose the requirement is to create the same set of IP4Address objects on several NetDefend Firewalls that already exist on a single unit. The administrator would connect to the single unit with the CLI and issue the command: gw-world:/> script -create Address IP4Address -name new_script.sgs This creates a script file called new_script_sgs which contains all the CLI commands necessary to create all IP4Address address objects in that unit's configuration. The created file's contents might, for example, be: add IP4Address If1_ip Address=10.6.60.10 add IP4Address If1_net Address=10.6.60.0/24 add IP4Address If1_br Address=10.6.60.255 add IP4Address If1_dns1 Address=141.1.1.1 " " " The file new_script_sgs can then be downloaded with SCP to the local management workstation and then uploaded and executed on the other NetDefend Firewalls. The end result is that all units will have the same IP4Address objects in their address book. The name of the file created using the -create option cannot be greater than 16 characters in length (including the extension) and the filetype should be .sgs. Tip: Listing commands at the console To list the created CLI commands on the console instead of saving them to a file, leave out the option -name= in the script -create command. Certain aspects of a configuration which are hardware dependent cannot have a script created using the -create option. This is true when the CLI node type in the script -create command is one of: COMPortDevice Ethernet EthernetDevice Device If one of these node types is used then the error message script file empty is returned by NetDefendOS. Commenting Script Files 44