Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Ignore IPv6 Route advertisement in case DHCPv6 wasn't requested #788

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/providers/vsphere/network/netplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions pkg/providers/vsphere/network/netplan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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}))
Expand Down