Forum Discussion
Syntax of Get-F5.iControl.NetworkingVLAN.Begincreate_v2
- Sep 08, 2017
I didn't realize it at the time, but there is an article that explains how to use this:
https://devcentral.f5.com/codeshare?sid=183
Here is the code that works if this can help anyone else in the future! I needed to create VLANs that were both tagged and untagged, so I just made 2 functions for each. I'm only listing the tagged VLAN function here, but if you want to make an untagged one then just change the value of member.tag_state to UNTAGGED instead of TAGGED.
function Create-Tagged-VLAN() { param([string]$name, [long]$id, [string]$member_name); $vlans = (, $name); $vlan_ids = (, $id); $member = New-Object -TypeName iControl.NetworkingVLANMemberEntry; $member.member_name = $member_name $member.member_type = "MEMBER_INTERFACE"; $member.tag_state = "MEMBER_Tagged" $memberA = (, $member); $memberAofA = (, $memberA); $failsafe_states = (, "STATE_DISABLED"); $timeouts = (, 1500); $mac_masquerade = (, ""); $iControl.NetworkingVLAN.create( $vlans, $vlan_ids, $memberAofA, $failsafe_states, $timeouts, $mac_masquerade); } Create-Tagged-VLAN -name "VLAN-500" -id 500 -member_name "1.4";
I didn't realize it at the time, but there is an article that explains how to use this:
https://devcentral.f5.com/codeshare?sid=183
Here is the code that works if this can help anyone else in the future! I needed to create VLANs that were both tagged and untagged, so I just made 2 functions for each. I'm only listing the tagged VLAN function here, but if you want to make an untagged one then just change the value of member.tag_state to UNTAGGED instead of TAGGED.
function Create-Tagged-VLAN()
{
param([string]$name,
[long]$id,
[string]$member_name);
$vlans = (, $name);
$vlan_ids = (, $id);
$member = New-Object -TypeName iControl.NetworkingVLANMemberEntry;
$member.member_name = $member_name
$member.member_type = "MEMBER_INTERFACE";
$member.tag_state = "MEMBER_Tagged"
$memberA = (, $member);
$memberAofA = (, $memberA);
$failsafe_states = (, "STATE_DISABLED");
$timeouts = (, 1500);
$mac_masquerade = (, "");
$iControl.NetworkingVLAN.create(
$vlans,
$vlan_ids,
$memberAofA,
$failsafe_states,
$timeouts,
$mac_masquerade);
}
Create-Tagged-VLAN -name "VLAN-500" -id 500 -member_name "1.4";
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com