Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions ltm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2196,13 +2196,20 @@ func (b *BigIP) VirtualServers() (*VirtualServers, error) {
func (b *BigIP) CreateVirtualServer(name, destination, mask, pool string, vlans_enabled bool, port int, translate_address, translate_port string) error {
subnetMask := cidr[mask]

if strings.Contains(mask, ".") {
if strings.Contains(mask, ".") || strings.Contains(mask, ":") {
subnetMask = mask
}

destPort := fmt.Sprintf("%s:%d", destination, port)

// IPv6 Destinations use a "." port delimeter
if strings.Contains(destination, ":") {
destPort = fmt.Sprintf("%s.%d", destination, port)
}

config := &VirtualServer{
Name: name,
Destination: fmt.Sprintf("%s:%d", destination, port),
Destination: destPort,
Mask: subnetMask,
Pool: pool,
TranslateAddress: translate_address,
Expand Down