-
Notifications
You must be signed in to change notification settings - Fork 692
Open
Labels
area/clilimactl CLI user experiencelimactl CLI user experience
Description
Description
When trying to use the command limactl network create
to create a bridged network, it results in a error
failed to parse CIDR "/24": invalid CIDR address: /24
I'm assuming the error is here because you cannot add gateway / IP ranges as they are managed outside.
Lines 177 to 207 in bd955e4
switch mode { | |
case networks.ModeBridged: | |
if gateway != "" { | |
return fmt.Errorf("network mode %q does not support specifying gateway", mode) | |
} | |
if intf == "" { | |
return fmt.Errorf("network mode %q requires specifying interface", mode) | |
} | |
default: | |
if gateway == "" { | |
return fmt.Errorf("network mode %q requires specifying gateway", mode) | |
} | |
if intf != "" { | |
return fmt.Errorf("network mode %q does not support specifying interface", mode) | |
} | |
} | |
if !strings.Contains(gateway, "/") { | |
gateway += "/24" | |
} | |
gwIP, gwMask, err := net.ParseCIDR(gateway) | |
if err != nil { | |
return fmt.Errorf("failed to parse CIDR %q: %w", gateway, err) | |
} | |
if gwIP.IsUnspecified() || gwIP.IsLoopback() { | |
return fmt.Errorf("invalid IP address: %v", gwIP) | |
} | |
gwMaskStr := "255.255.255.0" | |
if gwMask != nil { | |
gwMaskStr = net.IP(gwMask.Mask).String() | |
} |
Metadata
Metadata
Assignees
Labels
area/clilimactl CLI user experiencelimactl CLI user experience