Skip to content

Commit df33a11

Browse files
committed
incus/network: use the ovn router address as dns server for dhcp in isolated (network=none) ovn networks
1 parent 36701b9 commit df33a11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/server/network/driver_ovn.go

+4
Original file line numberDiff line numberDiff line change
@@ -2660,6 +2660,8 @@ func (n *ovn) setup(update bool) error {
26602660

26612661
if uplinkNet != nil {
26622662
opts.RecursiveDNSServer = uplinkNet.dnsIPv4
2663+
} else {
2664+
opts.RecursiveDNSServer = []net.IP{routerIntPortIPv4}
26632665
}
26642666

26652667
err = n.ovnnb.UpdateLogicalSwitchDHCPv4Options(context.TODO(), n.getIntSwitchName(), dhcpv4UUID, dhcpV4Subnet, opts)
@@ -2677,6 +2679,8 @@ func (n *ovn) setup(update bool) error {
26772679

26782680
if uplinkNet != nil {
26792681
opts.RecursiveDNSServer = uplinkNet.dnsIPv6
2682+
} else {
2683+
opts.RecursiveDNSServer = []net.IP{routerIntPortIPv6}
26802684
}
26812685

26822686
err = n.ovnnb.UpdateLogicalSwitchDHCPv6Options(context.TODO(), n.getIntSwitchName(), dhcpv6UUID, dhcpV6Subnet, opts)

0 commit comments

Comments
 (0)