Main Menu
  • COMPANY
    • Boundless Cybersecurity
    • Press Releases
    • News
    • Events
    • Awards
    • Leadership
    • Press Kit
    • Careers
  • PROMOTIONS
    • SonicWall Promotions
    • Customer Loyalty Program
  • MANAGED SERVICES
    • Managed Security Services
    • Security as a Service
    • Professional Services
SonicWall
  • Products
      All Products A–Z
      Free Trials
    • Network Security
      • Next-Generation Firewall (NGFW)
      • Network Security Services
      • Network Security Management
      • Secure SD-WAN
    • Threat Protection
      • Advanced Threat Protection Cloud
      • Advanced Threat Protection Appliance
      • Capture Labs
    • Secure Access Service Edge (SASE)
      • Zero-Trust Network Access (ZTNA)
    • Cloud Security
      • Cloud Firewall
      • Cloud App Security
    • Endpoint Security
      • Endpoint Detection & Response (EDR)
    • Email Security
      • Cloud Email Security
      • Hosted Email Security
      • On-Prem Email Security
    • Secure Access
      • Wireless Access Points
      • Network Switch
      • Virtual Private Network (VPN)
    • Wi-Fi 6 Access Points

      SonicWall SonicWave 600 series access points provide always-on, always-secure connectivity for complex, multi-device environments.

      Read More
  • Solutions
    • Industries
      • Distributed Enterprises
      • Retail & Hospitality
      • K-12 Education
      • Higher Education
      • State & Local
      • Federal
      • Healthcare
      • Financial Services
      • Carriers
    • Use Cases
      • Secure SD-Branch
      • Network Segmentation
      • Zero Trust Security
      • Secure SD-WAN
      • Office 365 Security
      • SaaS Security
      • Secure Wi-Fi
    • Solutions Widgets
      • Solutions Content Widgets
        Federal

        Protect Federal Agencies and Networks with scalable, purpose-built cybersecurity solutions

      • Solutions Image Widgets
  • Partners
    • SonicWall Partners
      • Partners Overview
      • Find a Partner
      • Authorized Distributors
      • Technology Partners
    • Partner Resources
      • Become a Partner
      • SonicWall University
      • Training & Certification
    • Partner Widgets
      • Custom HTML : Partners Content WIdgets
        Partner Portal

        Access to deal registration, MDF, sales and marketing tools, training and more

      • Partners Image Widgets
  • Support
    • Support
      • Support Portal
      • Knowledge Base
      • Technical Documentation
      • Community
      • Video Tutorials
      • Product Life Cycle Tables
      • Partner Enabled Services
      • Contact Support
    • Resources
      • Resource Center
      • Events
      • Free Trials
      • Blog
      • SonicWall University
      • MySonicWall
    • Capture Labs
      • Capture Labs
      • Security Center
      • Security News
      • PSIRT
      • Application Catalog
    • Support Widget
      • Custom HTML : Support Content WIdgets
        Support Portal

        Find answers to your questions by searching across our knowledge base, community, technical documentation and video tutorials

      • Support Image Widgets
  • COMPANY
    • Boundless Cybersecurity
    • Press Releases
    • News
    • Events
    • Awards
    • Leadership
    • Press Kit
    • Careers
  • PROMOTIONS
    • SonicWall Promotions
    • Customer Loyalty Program
  • MANAGED SERVICES
    • Managed Security Services
    • Security as a Service
    • Professional Services
  • Contact Sales
  • English English English en
  • BLOG
  • CONTACT SALES
  • FREE TRIALS
  • English English English en
SonicWall
  • Products
      All Products A–Z
      Free Trials
    • Network Security
      • Next-Generation Firewall (NGFW)
      • Network Security Services
      • Network Security Management
      • Secure SD-WAN
    • Threat Protection
      • Advanced Threat Protection Cloud
      • Advanced Threat Protection Appliance
      • Capture Labs
    • Secure Access Service Edge (SASE)
      • Zero-Trust Network Access (ZTNA)
    • Cloud Security
      • Cloud Firewall
      • Cloud App Security
    • Endpoint Security
      • Endpoint Detection & Response (EDR)
    • Email Security
      • Cloud Email Security
      • Hosted Email Security
      • On-Prem Email Security
    • Secure Access
      • Wireless Access Points
      • Network Switch
      • Virtual Private Network (VPN)
    • Wi-Fi 6 Access Points

      SonicWall SonicWave 600 series access points provide always-on, always-secure connectivity for complex, multi-device environments.

      Read More
  • Solutions
    • Industries
      • Distributed Enterprises
      • Retail & Hospitality
      • K-12 Education
      • Higher Education
      • State & Local
      • Federal
      • Healthcare
      • Financial Services
      • Carriers
    • Use Cases
      • Secure SD-Branch
      • Network Segmentation
      • Zero Trust Security
      • Secure SD-WAN
      • Office 365 Security
      • SaaS Security
      • Secure Wi-Fi
    • Solutions Widgets
      • Solutions Content Widgets
        Federal

        Protect Federal Agencies and Networks with scalable, purpose-built cybersecurity solutions

      • Solutions Image Widgets
  • Partners
    • SonicWall Partners
      • Partners Overview
      • Find a Partner
      • Authorized Distributors
      • Technology Partners
    • Partner Resources
      • Become a Partner
      • SonicWall University
      • Training & Certification
    • Partner Widgets
      • Custom HTML : Partners Content WIdgets
        Partner Portal

        Access to deal registration, MDF, sales and marketing tools, training and more

      • Partners Image Widgets
  • Support
    • Support
      • Support Portal
      • Knowledge Base
      • Technical Documentation
      • Community
      • Video Tutorials
      • Product Life Cycle Tables
      • Partner Enabled Services
      • Contact Support
    • Resources
      • Resource Center
      • Events
      • Free Trials
      • Blog
      • SonicWall University
      • MySonicWall
    • Capture Labs
      • Capture Labs
      • Security Center
      • Security News
      • PSIRT
      • Application Catalog
    • Support Widget
      • Custom HTML : Support Content WIdgets
        Support Portal

        Find answers to your questions by searching across our knowledge base, community, technical documentation and video tutorials

      • Support Image Widgets
  • COMPANY
    • Boundless Cybersecurity
    • Press Releases
    • News
    • Events
    • Awards
    • Leadership
    • Press Kit
    • Careers
  • PROMOTIONS
    • SonicWall Promotions
    • Customer Loyalty Program
  • MANAGED SERVICES
    • Managed Security Services
    • Security as a Service
    • Professional Services
  • Contact Sales
  • Menu

Exporting Configuration in JSON, XML from a SonicWall Firewall

03/26/2020 15 People found this article helpful 197,256 Views

    Download
    Print
    Share
    • LinkedIn
    • Twitter
    • Facebook
    • Email
    • Copy URL The link has been copied to clipboard

    Description

    It is often desirable to retrieve the configuration of a firewall from the command line interface (CLI), either in the form of a Tech Support Report (TSR) or selectively (e.g., Access Rules or NAT policies). This article provides a brief description on how to generate configurations selectively in the CLI and store it in a file. The CLI is accessible either via the Terminal (Serial) or using the SSH management (Fig. 1).

    Image

    Fig. 1. Accessing CLI from the Terminal (a,b) using the Console/MGMT Port or by SSH (c). Please note that in the newer models such as NSa 2650, a Console Port is labeled as a management port (MGMT).

    Terminal Access:

    Terminal Access from a computer is achieved by connecting it to the firewall's Console port (Fig. 2) with a serial cable. These are RJ45 (connected to the Firewall) to DB9 (connected to the computer) cables that facilitate serial communication between two devices. Please note that a serial port is often missing on the newer generation of computers. Therefore one may use a Serial to USB adapter.

    Image

     Fig. 2. A Serial Cable used for Terminal Access via the console port. Also shown are the pin configurations and a Serial to USB Adapter.

    When one uses a USB adapter, the host computer assigns it a COM port, which can be found, for example, in the Device Manager (CMD: devmgmt.msc) of Windows (Fig. 3).

    Image

    Fig. 3. Device Manager in Windows. The USB adapter has been assigned COM3.

    SSH Access:

    One can access the firewall's CLI by SSH. This requires enabling SSH management on an interface (Network | Interfaces), typically LAN or Management (Fig. 4). SSH access uses an RJ45 cable connection.

    Image

    Fig. 4. Setting up SSH access on an interface (Network | Interfaces : e.g., X0).

    Using a Software Client:

    A common practice to access the CLI is by using a client like Putty. Unix and Linux have SSH built into them. It is important to note that the SonicWall firewalls do not allow one to save files locally, although one may set up an FTP server to upload diagnostic files. A more convenient way to save the outputs from a CLI access is via the LOG file in putty (Fig. 5).

    Image

    Fig. 5. Setting the putty.log allows one to save all the data from a session.

    Based on the type of access- Serial or SSH, the Putty session is configured appropriately (Fig. 6).

    Image

    Fig. 6. Serial Access from Putty. Notice the Serial settings (left), which have to be configured before initiating the session.

     

     

    Resolution

    Setting the format of CLI output:

    The format of the output from a command can either be set in the command as in Sonic OS 5x (Gen 5, Fig. 7) or globally as in SonicOS 6x (Gen 6, Fig. 8). Please note that in SonicOS > 6.2.0 the only supported modes are plain-text (default) and JSON.

    Image

    Image

    Fig. 7. Setting up the format of output in Gen 5, e.g., show nat-policies default xml

     A global configuration for output format and the output in Gen 6 is shown in Fig. 8.

    Image

    Fig. 8. Setting up JSON as the output format in Gen 6.

    As mentioned earlier, the newer versions of Gen 6 do not support xml. One may consider a converter should such format is required (Fig. 9).

    Fig. 9. JSON to XML conversion options.

    Reviewing the CLI outputs:

    As the Putty Session logs all the outputs, the command outputs can be retrieved on a text editor- Note Pad or Note Pad++

    Related Articles

    • Bandwidth usage and tracking in SonicWall
    • How to force an update of the Security Services Signatures from the Firewall GUI
    • Configure Guest VLAN in the TZ firewall, for guest users to access Internet only.

    Categories

    • Firewalls > TZ Series > Command Line Interface - CLI
    • Firewalls > SonicWall NSA Series > Command Line Interface - CLI

    Not Finding Your Answers?

    ASK THE COMMUNITY

    Was This Article Helpful?

    YESNO

    Article Helpful Form

    Article Not Helpful Form

    Company
    • Careers
    • News
    • Leadership
    • Awards
    • Press Kit
    • Contact Us
    Popular resources
    • Communities
    • Blog
    • SonicWall Capture Labs

    Stay In Touch

    • By submitting this form, you agree to our Terms of Use and acknowledge our Privacy Statement. You can unsubscribe at any time from the Preference Center.
    • This field is for validation purposes and should be left unchanged.
    • Facebook
    • Twitter
    • Linkedin
    • Youtube
    • Instagram

    © 2023 SonicWall. All Rights Reserved.

    • Legal
    • Privacy
    • English
    Scroll to top