diff --git a/pkg/providers/vsphere/network/netplan.go b/pkg/providers/vsphere/network/netplan.go index b4e9676cb..979e7957d 100644 --- a/pkg/providers/vsphere/network/netplan.go +++ b/pkg/providers/vsphere/network/netplan.go @@ -20,6 +20,7 @@ type NetplanEthernet struct { SetName string `json:"set-name,omitempty"` Dhcp4 bool `json:"dhcp4,omitempty"` Dhcp6 bool `json:"dhcp6,omitempty"` + AcceptRA bool `json:"accept-ra,omitempty"` Addresses []string `json:"addresses,omitempty"` Gateway4 string `json:"gateway4,omitempty"` Gateway6 string `json:"gateway6,omitempty"` @@ -64,6 +65,9 @@ func NetPlanCustomization(result NetworkInterfaceResults) (*Netplan, error) { npEth.Dhcp4 = r.DHCP4 npEth.Dhcp6 = r.DHCP6 + // Right now we can set the same value as DHCPv6 configuration + // and in some future separate/specialize if required + npEth.AcceptRA = r.DHCP6 if !npEth.Dhcp4 { for _, ipConfig := range r.IPConfigs { diff --git a/pkg/providers/vsphere/network/netplan_test.go b/pkg/providers/vsphere/network/netplan_test.go index 5e93d35b3..b875548e2 100644 --- a/pkg/providers/vsphere/network/netplan_test.go +++ b/pkg/providers/vsphere/network/netplan_test.go @@ -94,6 +94,7 @@ var _ = Describe("Netplan", func() { Expect(np.SetName).To(Equal(guestDevName)) Expect(np.Dhcp4).To(BeFalse()) Expect(np.Dhcp6).To(BeFalse()) + Expect(np.AcceptRA).To(BeFalse()) Expect(np.Addresses).To(HaveLen(2)) Expect(np.Addresses[0]).To(Equal(ipv4CIDR)) Expect(np.Addresses[1]).To(Equal(ipv6 + fmt.Sprintf("/%d", ipv6Subnet))) @@ -139,6 +140,7 @@ var _ = Describe("Netplan", func() { Expect(np.SetName).To(Equal(guestDevName)) Expect(np.Dhcp4).To(BeTrue()) Expect(np.Dhcp6).To(BeTrue()) + Expect(np.AcceptRA).To(BeTrue()) Expect(np.MTU).To(BeEquivalentTo(9000)) Expect(np.Nameservers.Addresses).To(Equal([]string{dnsServer1})) Expect(np.Nameservers.Search).To(Equal([]string{searchDomain1}))