Skip to content

Commit ca85513

Browse files
authored
Merge pull request #1898 from balajiv113/alpine-fix
Fix DNS issue with alpine after upgrade
2 parents 1256ed0 + cd474e6 commit ca85513

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -eux
3+
4+
# This script prepares Alpine for lima; there is nothing in here for other distros
5+
test -f /etc/alpine-release || exit 0
6+
7+
# need to update /etc/resolv.conf
8+
rc-service networking restart

pkg/networks/usernet/gvproxy.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ var (
3737
opts *GVisorNetstackOpts
3838
)
3939

40+
const gatewayMacAddr = "5a:94:ef:e4:0c:dd"
41+
4042
func StartGVisorNetstack(ctx context.Context, gVisorOpts *GVisorNetstackOpts) error {
4143
opts = gVisorOpts
4244

@@ -54,7 +56,7 @@ func StartGVisorNetstack(ctx context.Context, gVisorOpts *GVisorNetstackOpts) er
5456
}
5557
}
5658
}
57-
leases[gatewayIP] = "5a:94:ef:e4:0c:df"
59+
leases[gatewayIP] = gatewayMacAddr
5860

5961
// The way gvisor-tap-vsock implemented slirp is different from tradition SLIRP,
6062
// - GatewayIP handling all request, also answers DNS queries
@@ -67,7 +69,7 @@ func StartGVisorNetstack(ctx context.Context, gVisorOpts *GVisorNetstackOpts) er
6769
MTU: opts.MTU,
6870
Subnet: opts.Subnet,
6971
GatewayIP: gatewayIP,
70-
GatewayMacAddress: "5a:94:ef:e4:0c:dd",
72+
GatewayMacAddress: gatewayMacAddr,
7173
DHCPStaticLeases: leases,
7274
Forwards: map[string]string{},
7375
DNS: []types.Zone{},

0 commit comments

Comments
 (0)