Skip to content

Commit 766708c

Browse files
authored
Merge pull request #518 from rancher-sandbox/cidata-slirpipaddress
Add LIMA_CIDATA_SLIRP_IP_ADDRESS setting to lima.env
2 parents 5943068 + d815514 commit 766708c

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

docs/internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,6 @@ The volume label is "cidata", as defined by [cloud-init NoCloud](https://cloudin
112112
- `LIMA_CIDATA_CONTAINERD_SYSTEM`: set to "1" if system-wide containerd to be set up
113113
- `LIMA_CIDATA_SLIRP_GATEWAY`: set to the IP address of the host on the SLIRP network. `192.168.5.2`.
114114
- `LIMA_CIDATA_SLIRP_DNS`: set to the IP address of the DNS on the SLIRP network. `192.168.5.3`.
115+
- `LIMA_CIDATA_SLIRP_IP_ADDRESS`: set to the IP address of the guest on the SLIRP network. `192.168.5.15`.
115116
- `LIMA_CIDATA_UDP_DNS_LOCAL_PORT`: set to the udp port number of the hostagent dns server (or 0 when not enabled).
116117
- `LIMA_CIDATA_TCP_DNS_LOCAL_PORT`: set to the tcp port number of the hostagent dns server (or 0 when not enabled).

pkg/cidata/cidata.TEMPLATE.d/lima.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ LIMA_CIDATA_CONTAINERD_SYSTEM=
1717
{{- end}}
1818
LIMA_CIDATA_SLIRP_DNS={{.SlirpDNS}}
1919
LIMA_CIDATA_SLIRP_GATEWAY={{.SlirpGateway}}
20+
LIMA_CIDATA_SLIRP_IP_ADDRESS={{.SlirpIPAddress}}
2021
LIMA_CIDATA_UDP_DNS_LOCAL_PORT={{.UDPDNSLocalPort}}
2122
LIMA_CIDATA_TCP_DNS_LOCAL_PORT={{.TCPDNSLocalPort}}

pkg/cidata/cidata.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,14 @@ func GenerateISO9660(instDir, name string, y *limayaml.LimaYAML, udpDNSLocalPort
9696
return err
9797
}
9898
args := TemplateArgs{
99-
Name: name,
100-
User: u.Username,
101-
UID: uid,
102-
Containerd: Containerd{System: *y.Containerd.System, User: *y.Containerd.User},
103-
SlirpNICName: qemu.SlirpNICName,
104-
SlirpGateway: qemu.SlirpGateway,
105-
SlirpDNS: qemu.SlirpDNS,
99+
Name: name,
100+
User: u.Username,
101+
UID: uid,
102+
Containerd: Containerd{System: *y.Containerd.System, User: *y.Containerd.User},
103+
SlirpNICName: qemu.SlirpNICName,
104+
SlirpGateway: qemu.SlirpGateway,
105+
SlirpDNS: qemu.SlirpDNS,
106+
SlirpIPAddress: qemu.SlirpIPAddress,
106107
}
107108

108109
// change instance id on every boot so network config will be processed again

pkg/cidata/template.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type TemplateArgs struct {
3939
SlirpNICName string
4040
SlirpGateway string
4141
SlirpDNS string
42+
SlirpIPAddress string
4243
UDPDNSLocalPort int
4344
TCPDNSLocalPort int
4445
Env map[string]string

0 commit comments

Comments
 (0)