Main Menu
  • COMPANY
    • Boundless Cybersecurity
    • Press Releases
    • News
    • Awards
    • Leadership
    • Press Kit
    • Careers
  • PROMOTIONS
    • Customer Loyalty Program
  • MANAGED SERVICES
    • Managed Security Services
    • Security as a Service
    • Professional Services
SonicWall
  • Products
    • Network Security
      • Next Generation FirewallNext-generation firewall for SMB, Enterprise, and Government
      • Security ServicesComprehensive security for your network security solution
      • Network Security ManagerModern Security Management for today’s security landscape
    • Advanced Threat Protection
      • Capture ATPMulti-engine advanced threat detection
      • Capture Security applianceAdvanced Threat Protection for modern threat landscape
    • Access Security
      • Cloud Edge Secure AccessDeploy Zero-Trust Security in minutes
      • Secure Mobile AccessRemote, best-in-class, secure access
      • Wireless Access PointsEasy to manage, fast and secure Wi-FI
      • SwitchesHigh-speed network switching for business connectivity
    • Email Security
      • Email SecurityProtect against today’s advanced email threats
    • Cloud Security
      • Cloud App SecurityVisibility and security for Cloud Apps
      • Cloud Firewall (NSv)Next-generation firewall capabilities in the cloud
    • Endpoint Security
      • Capture ClientStop advanced threats and rollback the damage caused by malware
      • Content Filtering ClientControl access to unwanted and unsecure web content
    • Product Widgets
      • Product Menu Right Image
      • Capture Cloud Platform
        Capture Cloud Platform

        A security ecosystem to harness the power of the cloud

    • Button Widgets
      • Products A-Z
        all products A–Z FREE TRIALS
  • Solutions
    • Industries
      • Distributed Enterprises
      • Retail & Hospitality
      • K-12 Education
      • Higher Education
      • State & Local
      • Federal
      • Healthcare
      • Financial Services
      • Carriers
    • Use Cases
      • Secure SD-Branch
      • Zero Trust Security
      • Secure SD-WAN
      • Office 365 Security
      • SaaS Security
      • Secure WiFi
    • 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
      • 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
    • Awards
    • Leadership
    • Press Kit
    • Careers
  • 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
    • Network Security
      • Next Generation FirewallNext-generation firewall for SMB, Enterprise, and Government
      • Security ServicesComprehensive security for your network security solution
      • Network Security ManagerModern Security Management for today’s security landscape
    • Advanced Threat Protection
      • Capture ATPMulti-engine advanced threat detection
      • Capture Security applianceAdvanced Threat Protection for modern threat landscape
    • Access Security
      • Cloud Edge Secure AccessDeploy Zero-Trust Security in minutes
      • Secure Mobile AccessRemote, best-in-class, secure access
      • Wireless Access PointsEasy to manage, fast and secure Wi-FI
      • SwitchesHigh-speed network switching for business connectivity
    • Email Security
      • Email SecurityProtect against today’s advanced email threats
    • Cloud Security
      • Cloud App SecurityVisibility and security for Cloud Apps
      • Cloud Firewall (NSv)Next-generation firewall capabilities in the cloud
    • Endpoint Security
      • Capture ClientStop advanced threats and rollback the damage caused by malware
      • Content Filtering ClientControl access to unwanted and unsecure web content
    • Product Widgets
      • Product Menu Right Image
      • Capture Cloud Platform
        Capture Cloud Platform

        A security ecosystem to harness the power of the cloud

    • Button Widgets
      • Products A-Z
        all products A–Z FREE TRIALS
  • Solutions
    • Industries
      • Distributed Enterprises
      • Retail & Hospitality
      • K-12 Education
      • Higher Education
      • State & Local
      • Federal
      • Healthcare
      • Financial Services
      • Carriers
    • Use Cases
      • Secure SD-Branch
      • Zero Trust Security
      • Secure SD-WAN
      • Office 365 Security
      • SaaS Security
      • Secure WiFi
    • 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
      • 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
    • Awards
    • Leadership
    • Press Kit
    • Careers
  • PROMOTIONS
    • Customer Loyalty Program
  • MANAGED SERVICES
    • Managed Security Services
    • Security as a Service
    • Professional Services
  • Contact Sales
  • Menu

How To migrate FQDN address objects from a Gen 6 to Gen 7 device using SonicOS API?

08/13/2020 0 People found this article helpful 89,042 Views

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

    Description

    There are always situations where you have added many FQDN address objects to be used for exclusions and want the same address objects on other firewalls for similar exclusions. This KB explains how you can use SonicOS API to retrieve the FQDN address objects from a Generation 6 firewall and add them on a Gen 7 device running SonicOS 7.0 or SonicOSX 7.0.

    TIP: The URL varies based on the type of the objects that you are adding or retrieving. Please refer https://sonicos-api.sonicwall.com for the entire list.


    Resolution

    EXAMPLE: In this example, we are going to retrieve the FQDN address objects from a TZ 500 running 6.5.4.6-79n reachable via IP: 192.168.188.100 on port TCP 444 and add those address objects on a TZ 670 running SonicOS 7.0 reachable via IP: 192.168.188.50 on port TCP 443. 

    NOTE: The same steps can be used for a Gen 7 device running SonicOSX 7.0. Also, if you already have the FQDN address objects in JSON format, scroll down to Part 2 of this KB and follow the steps required for Gen 7 device.

    You would need to perform the following steps to retrieve the FQDN address objects from Gen 6 device:

    1. Enabling the API Module on the firewall UI.
      Login to the SonicWall management UI. Navigate to MANAGE | Appliance | Base Settings and scroll down to SonicOS API section. Enable the option 'Enable SonicOS API' and 'Enable RFC-2617 HTTP Basic Access authentication' option.
      Image

    2. List of applicable APIs:
      Navigate to MANAGE | API and click on the link https://SonicOS-api.sonicwall.com. Swagger will prepopulate your SonicWalls’s IP, MGMT Port, Firmware so it can give you a list of applicable APIs.
      Image
      Image

      TIP: You are free to choose Swagger, Postman, Git bash, or any application that allows API calls, if you are using a Linux based operating system you can execute cURL from the terminal. In this article, we are using Postman on Windows.

    3. Login to the Firewall using Postman.

      a) The HTTP method should be POST and we need to use the URL: https://192.168.188.100:444/api/sonicos/auth
      Under the authorization tab, select Basic Auth and mention the correct admin credentials.

      NOTE: https://192.168.188.100:444/-- Replace this with your SonicWall's Public or private IP address with the right management port number (If the management port is 443, you can directly use https:// followed by the IP address without the port number too). 


       Image

      b) Under the settings tab, turn OFF the Enable SSL certificate verification if the firewall is using a self-signed certificate for management.
      Image

      c) Under the headers tab, include application/json as the value for keys Accept and Content-type. After this, click on the Send button and then you can see the response on the section below. The response should contain a message: "success".
      Image

    4. Retrieving all FQDN address objects in JSON format.
      The HTTP method should be GET and we need to use the URL: https://192.168.188.100:444/api/sonicos/address-objects/fqdn
      The other fields can be left the same as before and click on Send. The response for this HTTP method would contain the list of all FQDN address objects present on this firewall.
      Image

      Use the Save Response button and save it in a file. You can open that file in any text editor and that should have all the FQDN address objects as a collection in JSON format as below. We would need this as an input in the next section.

      Image

    5. Log out of the SonicWall with API
      It is recommended to log out from the SonicWall via API once the desired configuration is committed. In this case, we do not want to make any changes but just retrieve some information.
      The HTTP method should be DELETE and we need to use the URL: https://192.168.188.100:444/api/sonicos/auth
      Click on the Send button and then you can see the response on the section below. The response should contain a message: "success".
      Image


    You would need to perform the following steps to add the FQDN address objects to Gen 7 device:

    1. Enabling the API Module on the firewall UI
      Login to the SonicWall management UI. The SonicOS API module is enabled by default and cannot be disabled. Navigate to DEVICE | Settings | Administration | Audit/SonicOS API tab and enable the toggle switch for RFC-2617 HTTP Basic Access authentication option.
      Image

    2. Login to the Firewall using Postman.
      a) The HTTP method should be POST and we need to use the URL: https://192.168.188.50/api/sonicos/auth
      Under authorization tab, select Basic Auth and mention the correct admin credentials.

      NOTE: https://192.168.188.50/-- Replace this with your SonicWalls Public or private IP address with the right management port number (If the management port is 443, you can directly use https:// followed by the IP address without the port number too).



      Image

      b) Under the settings tab, turn OFF the Enable SSL certificate verification if the firewall is using a self-signed certificate for management.
      Image

      c) Under the headers tab, include application/json as the value for keys Accept and Content-type.
      Image

      d) The Gen 7 devices are token driven. Use the {"override" : true} under the body to override any older tokens. After this, click on the Send button and then you can see the response on the section below. The response should contain a message: "success".
      Image

    3. Adding the collection of FQDN address objects in JSON format.
      The HTTP method should be PUT and we need to use the URL: https://192.168.188.50/api/sonicos/address-objects/fqdn

      NOTE: The HTTP POST method can also be used for this step. 


      The body should contain the collection of FQDN address objects in JSON format. Copy the same taken from step 4 in part 1 of this KB. The other fields can be left the same as before and click on Send. The response should contain a message: "success".
      Image

    4. Committing all the configurational changes made with APIs:
      The HTTP method should be POST and we need to use the URL: https://192.168.188.50/api/sonicos/config/pending
      The other fields can be left the same as before and click on Send. The response should contain a message: "success".
      Image

    5. Log out of the SonicWall with API
      It is recommended to log out from the SonicWall via API once the desired configuration is committed.
      The HTTP method should be DELETE and we need to use the URL: https://192.168.188.50/api/sonicos/auth
      Do not use {"override" : true} parameter in the body for log out. Click on the Send button and then you can see the response on the section below. The response should contain a message: "success".
      Image

    You can manually log in to the firewall to check the changes made. Navigate to OBJECT | Match Objects | Addresses to check for the changes.
    Image

    TIP: Postman offers another very good feature called as a global variable. You can save the URLs of the firewalls as global variables so that in case they change, all requests need not be re-written.

    1. To use this feature, click on the Eye button next to the Environment drop-down and click on Edit/Add next to Globals.
      Image
    2. Enter the variables and add their initial and current values that match the current IP address/hostnames for the firewalls and then click on Save.Image
    3. You can then use the variables in your requests as shown below. They should give you the exact same responses as before and the values can be updated if required.
      Image


    Related Articles

    • Parserror on Event logs.
    • Switch from the Policy mode to classic mode on Gen 7 appliances
    • Analyzing TCP reset(RST)packets

    Categories

    • Firewalls > TZ Series > Networking
    • Firewalls > NSa Series > Networking
    • Firewalls > NSv Series > Networking
    • Firewalls > SonicWall SuperMassive 9000 Series > Networking

    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

    © 2022 SonicWall. All Rights Reserved.

    • Legal
    • Privacy
    • English
      Scroll to top
      Trace:957d8e7b1ca3887eccd6a78a7ba67e6e-76