Guest User!

You are not Sophos Staff.

Interface / VLAN Migration via XML Import/Export

Disclaimer: This information is provided as-is for the benefit of the Community. Please contact Sophos Professional Services if you require assistance with your specific environment.


Hi, 

As some of you want to move the VLAN configuration or Interface configuration in XG from one interface to another, there is no way to do this in the GUI. So you could use the Import/Export feature in XG, to perform this operation.

Another use case would be to add as many VLANs as you want, with this approach. 

Cross reference: https://community.sophos.com/xg-firewall/f/recommended-reads/122450/creating-xml-objects-with-notepad-for-mass-import

How to

  1. My Interfaces

  2. Export of all interfaces via Import/Export:

  3. Using 7Zip to unzip the .tar file

  4. Using notepad++ to edit the Entities file

    1. Removing everything from the configuration except Port3 and VLAN. (You do not need to do that, but its way faster in the import process). 
  5. Only VLAN and Port3 left:

  6. Using "Find & Replace to replace Port3 with Port4

  7. Notepad++ will replace everything for you

  8. Opening the .tar File with 7zip 

  9. Using Drag&Drop and copy&replace the new Entities.xml within the .tar

    Note: Make sure, you saved the changes in notepad++!
     
  10. On XG, unbind the old Port3 and remove the configuration

  11. Import your new .tar on Import/Export

Note: This can take some time, as XG will add all VLANs to the interface. Depending on your appliance and the number of VLANs.


Updated Disclaimer
[edited by: Erick Jan at 10:18 AM (GMT -7) on 17 Apr 2023]
  • Thank you for this helfull guide!

    I am facing a migration from SG (UTM) to XGS (SFOS) with hundrets of VLANs an DHCP-Server.

    Its a firewall for internet access in a student hostel. So all the students have their own VLAN with an DHCP-Server.

    Sophos Migration Support converted the config of the SG and provided it to me as a .backup file that i successfully loaded in the XGS 2100.

    So far so good.

    I now have all the VLANs on the wrong interface.

    I tried to replace all "Port3" to "PortA1".

    The import lasts about 3 hours, but nothing changed.

    What did i wrong?

  • Check the apiparser.log on the CLI. See: https://docs.sophos.com/nsg/sophos-firewall/latest/Help/en-us/webhelp/onlinehelp/AdministratorHelp/Logs/LogFileDetails/index.html 
    Please create a own thread with the information to not flood this thread with investigations. 

    __________________________________________________________________________________________________________________

  • Hi, now in XG210 (SFOS 18.5.5 MR-5-Build509) if i download the Interface configuration file i have only the Physical Interfaces, the vlans are on a different file.

    Is this guide still valid? My aim is to move all vlans, that now spans across 3 physical ports, under one port only.

  • Yes you can do the same with different interfaces. But before uploading it to the firewall, you have to delete / remove the old VLANs. 

    __________________________________________________________________________________________________________________

  • Thanks! But this way i will still loose anything that is referenced to the Vlan interface when i delete it, right? For Example, dhcp configuration for dhcp server or relay? I just tried and i see that.

    There is any log that shows what dependent item has been deleted? The aim is to check if i had lost something important (rule, dhcp configuration, etc) during this interface change Slight smile

    Edited: i had misundertstood that i have to DELETE the vlan from the configuration before importing the .tar file. So i've tried to import the tar file without deleting the vlan and i get in the apiparser.log file an error about GatewayName and GatewayAddress not found. Looking on google i found a post about that -> Sophos Firewall Change Port of VLANs via XML

    I'm not on 19.5.1 but on 18.5.5 MR-5 but i think i have the same problem. I've tried the workaround but it didn't work.

    This is the XML i'm trying to import. The VLAN 777 actually is binded to port 8. I want it on the LAG_CORE interface (is a LAG with 3 ports, 1 connected the others 2 not, we are waiting for DACs)

    <?xml version="1.0" encoding="UTF-8"?>
    <Configuration APIVersion="1805.2" IPS_CAT_VER="1">
      <VLAN transactionid="">
        <Zone>LAN</Zone>
        <Interface>LAG_CORE</Interface>
        <Hardware>LAG_CORE.777</Hardware>
        <Name>test vlan 7771</Name>
        <VLANID>777</VLANID>
        <IPv4Configuration>Enable</IPv4Configuration>
        <IPv6Configuration>Disable</IPv6Configuration>
        <IPv4Assignment>Static</IPv4Assignment>
        <IPv6Address/>
        <IPv6Prefix/>
        <IPv6GatewayName/>
        <IPv6GatewayAddress/>
        <LocalIP/>
        <Status>Unplugged</Status>
        <IPv6Assignment/>
        <DHCPRapidCommit/>
        <IPAddress>172.16.77.1</IPAddress>
        <Netmask>255.255.255.0</Netmask>
      </VLAN>
    </Configuration>

  • You could export the dependencies as well and change the name of the interface like described here. 

    __________________________________________________________________________________________________________________

  • Right! I didn't thought to do it to get a view on what i could loose deleting the vlan interface.

    Thank you for responding on saturday xD

    By the way, any hint on how or what to try to get the VLAN only XML import to work? I should open a ticket?

    Have a nice weekend

  • Almost similar situation. I want to transfer the VLAN from Port1 to PortF1 (due to connecting to glass fibre).

    Is it the right way to export the DHCP and Interface items (as otherwise the whole configuration from the VLAN Interface under DHCP will  be lost)

    Then delete the VLAN

    And upload the modified configuration. Or will this not work on a XGS126?

    Note: for some reason I can not enter images (file embedding not allowed)

  • After 12 days with the Sophos Support i could confirm that this is not working when you are trying to move a VLAN from a Physical Interface to a LAG on 18.5.5 MR-5, no matter what (change name, add the tags for GatewayName and GatewayAddress