@@ -12,6 +12,7 @@ import (
12
12
"github.com/AkihiroSuda/lima/pkg/downloader"
13
13
"github.com/AkihiroSuda/lima/pkg/iso9660util"
14
14
"github.com/AkihiroSuda/lima/pkg/limayaml"
15
+ "github.com/AkihiroSuda/lima/pkg/qemu/qemuconst"
15
16
"github.com/AkihiroSuda/lima/pkg/store/filenames"
16
17
"github.com/docker/go-units"
17
18
"github.com/mattn/go-shellwords"
@@ -193,8 +194,8 @@ func Cmdline(cfg Config) (string, []string, error) {
193
194
args = append (args , "-cdrom" , filepath .Join (cfg .InstanceDir , filenames .CIDataISO ))
194
195
195
196
// Network
196
- // CIDR is intentionally hardcoded to 192.168.5.0/24, as each of QEMU has its own independent slirp network.
197
- args = append ( args , "-netdev" , fmt . Sprintf ( "user,id=net0,net=192.168.5.0/24,hostfwd=tcp:127.0.0.1:%d-:22" , y .SSH .LocalPort ))
197
+ args = append ( args , "-netdev" , fmt . Sprintf ( "user,id=net0,net=%s,dhcpstart=%s,hostfwd=tcp:127.0.0.1:%d-:22" ,
198
+ qemuconst . SlirpNetwork , qemuconst . SlirpIPAddress , y .SSH .LocalPort ))
198
199
args = append (args , "-device" , "virtio-net-pci,netdev=net0,mac=" + limayaml .MACAddress (cfg .InstanceDir ))
199
200
for i , vde := range y .Network .VDE {
200
201
// VDE4 accepts VNL like vde:///var/run/vde.ctl as well as file path like /var/run/vde.ctl .
0 commit comments