cancel
Showing results for 
Search instead for 
Did you mean: 
zthaker_377781
Historic F5 Account

Problem this snippet solves:

Add VLANs on BIGIP using bigsuds

How to use this snippet:

python .py <mgmt ip-addressof BIGIP>

Code :

#create Vlans

import sys
import paramiko
import bigsuds
import time                                                
username='admin'
password='admin'
print ("->Connecting to BIG-IP: "+sys.argv[1])
#you can use this instead:
#b= bigsuds.BIGIP(, 'admin', 'admin')

def createVLAN(username,password):
b = bigsuds.BIGIP(hostname=sys.argv[1],username=username,password=password)
b.Networking.VLAN.create_v2(vlans = ['external'], vlan_ids=[4094], members = [[{'member_name': '1.1', 'member_type': 'MEMBER_INTERFACE', 'tag_state': 'MEMBER_UNTAGGED'}]], failsafe_states = ['STATE_DISABLED'], timeouts = [100])
b.Networking.VLAN.create_v2(vlans = ['internal'], vlan_ids=[4093], members = [[{'member_name': '1.2', 'member_type': 'MEMBER_INTERFACE', 'tag_state': 'MEMBER_UNTAGGED'}]], failsafe_states = ['STATE_DISABLED'], timeouts = [100])

print(b.Networking.VLAN.get_list())



ssh = paramiko.SSHClient()
ssh.load_host_keys(os.path.expanduser(os.path.join("~", ".ssh", "known_hosts")))
ssh.connect(sys.argv[1], username="root", password="default")

createVLAN(username,password)
Version history
Last update:
‎25-Apr-2019 16:17
Updated by:
Contributors