cancel
Showing results for 
Search instead for 
Did you mean: 
PeteWhite
F5 Employee
F5 Employee

Problem this snippet solves:

This Python script will convert Alteon config files to F5 syntax configuration. This converts self-IPs, SSL certs, Nodes, Pools, Monitors, HTTP and ClientSSL profiles and Virtual Servers.

If you have any specific requirements then feel free to PM me.

How to use this snippet:

Install the script using pip:

pip install alteon2f5

Or download it here or from the site at https://pypi.org/project/alteon2f5/1.4/

Run it using: alteon2f5.py <name of input file> [partition name]

Options:

$ ./alteon2f5.py -h
usage: alteon2f5.py [-h] [--csv CSV] [--disable DISABLE] [--virtual VIRTUAL]
                    inputfile [partition]

Alteon Config Converter to F5 Syntax

positional arguments:
  inputfile          File containing Alteon Configuration
  partition          Optional partition name eg MyPartition

optional arguments:
  -h, --help         show this help message and exit
  --csv CSV          CSV-formatted modification file
  --disable DISABLE  Set all Virtual Addresses to disabled
  --virtual VIRTUAL  Output a single virtual server

It will output the config to the screen:

$ ./alteon2f5.py alteon.txt|more
# Configuration created on Tue Jan  8 14:01:26 2019
# Input filename: alteon.txt
# Partition: /Common/

# -- Number of objects --
# Type                  Number
# ----------------------------
# SSL certs             8
# Self-IPs              2
# Floating Self-IPs     2
# Nodes                 16
# Monitors - HTTP       8
# Pools                 12
# Virtual Addresses     3
# Virtual Servers       3
# ----------------------------

# -- Creating SSL certs --
<snipped>
#-------------------------------------------------------
#----- Configuration below this line   -----------------

net self IP_1.2.3.4 {
    address 1.2.3.4/24
    traffic-group traffic-group-local-only
    vlan VLAN-1234
}
...

It will also write the SSL certificates to the current directory. Copy the certs to the /var/tmp directory on the target BIG-IP and run the load_certs.sh script on the BIG-IP. This will install the SSL certs.

Copy the output text to the big-ip and load it using tmsh load sys config merge from-file /var/tmp/<config filename> verify.

If there are no errors then load the config using tmsh load sys config merge from-file /var/tmp/<config filename>

This should work with Python 2 and 3 and TMOS v11+.

There is also a bash script alteon2f5.sh which will read all of the txt files in the current directory and output all of the files into a new directory based on the name of the file

Code :

92405

Tested this on version:

11.0

Comments
Mladen_01_15037
Nimbostratus
Nimbostratus

Hi,

 

I installed your script and tried to convert alteon txt file, but there are no alteon2f5.py command on my PC. With pip list package is listed, but I cannot find any command.

 

Is it possible that you didn't add script in package?

 

BR, Mladen

 

PeteWhite
F5 Employee
F5 Employee

Thanks for letting me know Mladen. You are correct - I hadn't added the __init__.py file to the package and so it didn't add it. I've know sorted that in version 1.2 so maybe you can try it out and let me know how you get on. Let me know if you want any features adding.

 

PingXiong
F5 Employee
F5 Employee

Hi Pete,

 

What is the format of Alteon configuration file? Is it the configuration dump txt file?

 

Thanks!

PeteWhite
F5 Employee
F5 Employee

Yes, the config file is the Alteon config dump file

eg

script start "Alteon Application Switch 5224XL" 4  /**** DO NOT EDIT THIS LINE!
/* Configuration dump taken 13:30:31 Mon Jan 18, 2021
/* Configuration last applied at 10:35:27 Fri Jan 15, 2021
/* Configuration last save at 10:37:30 Fri Jan 15, 2021
/* Version 29.0.3.12, vADC Id 4,  Base MAC address 00:03:a2:c7:87:0a
/c/sys/mmgmt
	addr 192.168.10.111
	mask 255.255.255.0
	broad 192.168.10.255
	gw 192.168.10.3
	ena
	dns mgmt
	snmp mgmt
	syslog mgmt
	tftp mgmt

 

Version history
Last update:
‎05-May-2022 06:56
Updated by:
Contributors