Important note about SSL VPN compatibility for 20.0 MR1 with EoL SFOS versions and UTM9 OS. Learn more in the release notes.

Sophos Firewall: 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.


Overview

This Recommended read describes migrating vLAN to another Interface using the Import/Export Feature of Sophos Firewall.

Moving VLAN or Interface configurations in the GUI isn’t possible. However, the Import/Export feature in Sophos Firewall can perform the task.

Another workaround is to add many VLANs as another approach. You may refer to the following. 

Sophos Firewall: Creating XML Objects with Notepad++ for mass import 

Import/Export Configurations Step

Step 1. VLAN Interfaces 

To verify the Interfaces, Go to CONFIGURE>Network>Interfaces

Step 2. Export/Import Interfaces

Go to SYSTEM>Backup & Firmware>Import export

In the Export > Select Export Selective Configuration, choose Interface, then click Export.

Click Download

Step 3. Interface Configuration

Upon Exporting, this will download a TAR file. "Using 7Zip, unzip the .tar file.

Step 4. Editing Entities File

Using Notepad++, edit the Entities file.

To fasten the import process, remove every other configuration and only leave Port 3 and VLAN configurations.

Removing isn’t necessary. However, this will speed up the process.

Upon removing, the Tar file will only have the following

Step 5. Find & Replace

Using Notepad++, using the shortcut key, click Ctrl+H 

Or Click Search>Replace

This process in Notepad++ will replace the configuration.

Step 6. Replacing the Tar File.

Opening the .tar File with 7zip 

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

Note: Make sure, you saved the changes in Notepad++!
 

Step 7. Unbinding Old Port

in Sophos Firewall, unbind the old Port3 and remove the configuration

Step 8. Importing new.TAR File 

Upon replacing the new configuration in the .tar file and removing the configuration from the old port. We can now Import the new configuration.

Go back to SYSTEM>Backup & Firmware> Import export

Upload the edited/new .tar file by clicking "Choose File." 

Note: This can take some time, as Sophos Firewall will add all VLANs to the interface.
The upload speed will depend on your appliance and the number of VLANs.



Grammar
[edited by: Raphael Alganes at 2:16 PM (GMT -8) on 14 Nov 2024]
Parents
  • 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. 

    __________________________________________________________________________________________________________________

Reply Children