Open neil2048 opened 6 years ago
Hi Neil,
What cmdlet do you are using ?
Hi
Im using Several, cut some code out for clarity.. I have tried 650001824 as well as 65000.1824 and it round with the dot notation, and errors without with :- "Cannot validate argument on parameter 'RemoteAS'. The 664801824 argument is greater than the maximum allowed range of 65535. Supply an argument that is less than or equal to 65535 and then try the command again."
Get-Nsxlogicalrouter $($row[0]) | Get-NsxLogicalRouterRouting | Set-NsxLogicalRouterRouting -EnableBgp -ProtocolAddress $($row[18]) -ForwardingAddress $($row[8]) -LocalAS ($row[6])
Get-NsxLogicalRouter $($row[0]) | Get-NsxLogicalRouterRouting | New-NsxLogicalRouterBgpNeighbour -IpAddress $($row2[1]) -RemoteAS $($row2[2])
Get-NSXEdge $($row[0]) | Get-NsxEdgeRouting | Set-NsxEdgeRouting -EnableBgp -LocalAS $($row[6]) Get-NSXEdge $($row[0]) | Get-NsxEdgeRouting | New-NsxEdgeBgpNeighbour -RemoteAS $($row2[2])
It seems to be across the board on Edges and Logical Routers. I assume it needs a coding update?
Thanks
Neil
Hi @neil2048
Thanks for logging the issue.
The problem is that the current validation for BGP AS numbers in PowerNSX is only checking for a value from 0-65535
With the introduction of the 4-Byte ASN, there are multiple options that NSX-v will now accept.
We will take a look at the code and see how we can implement better BGP AS validation across the board so that 4-Byte AS numbers are accepted.
However, to workaround the issue, you will likely need to comment out the validation code in the cmdlets you need to use for the time being.
If your feeling real adventurous, you could trying using invoke-nsxrestmethod
and constructing your own XML.
Regards Dale
Oh...
it will be more complicated... because API add a new "field" for 4 Bytes ASN : localASNumber (and RemoteASNumber for BGP Neighbours) Need to add support of this new field...
Hi
yes, i have a work around for the ESG's at least where i can call
$edge = Get-NSXEdge $($row[0]) $edge.features.routing.bgp.bgpNeighbours.bgpNeighbour[$peerid].remoteASNumber = $($row2[2]) $peerid++ $edge | Set-NSXEdge -confirm:$false
inside a foreach loop incrementing $peerid each iteration, this appears to work, however im still struggling to apply the same config to the LogicalRouters, Im just double checking the code on the LogicalRouter side. then Ill advise shortly if this workaround also works.
Thanks
Yes the same code does work for the Get/Set-NSXLogicalRouter cmdlets also using $edge.features.routing.bgp.localASNumber = $($row[6]) to set the local AS number to a 4 byte one.
Yes, it is the same "API" for NsxLogicialRouter and NSXEdge...
This looks like it has fallen by the wayside. It sure would be nice to have it accept Int64! Figured out my own work around. I haven't done all of the iterations yet, but this will get most people started. I didn't understand what the previous posters were doing, cuz not PowerShell guru.
I created the DLR with a bunk 2 byte AS number, and then GET'd the XML down for the DLR, edited it with the 4 byte AS number, and did a PUT on it.
[xml]$XMLDoc = Invoke-NsxRestMethod -Method get -Uri "/api/4.0/edges/$DLREdgeID/routing/config" $XMLDoc.routing.bgp.localASNumber = $DLRBGPLAS # This var is for the 4 byte ASN Invoke-NsxRestMethod -Method put -Uri "/api/4.0/edges/$DLREdgeID/routing/config" -body $XMLDoc.OuterXml #Now put the updated XML back into the API.
-Kyle
Hi
Im automating an NSX-V install and the customer want to use 4 byte AS numbering, this was supported from NSX 6.3, how every when i code in PowerNSX the local or remote AS numbers, using the dot notation 65000.1824, this always apears as 65001 in NSX.
is there a specific way to code this for PowerNSX?
Thanks