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

fix: DHCP fails with a VLAN ID #878

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions pkg/console/install_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ func addNetworkPanel(c *Console) error {
c.config.ManagementInterface = mgmtNetwork

if mgmtNetwork.Method == config.NetworkMethodDHCP {
addr, err := getIPThroughDHCP(config.MgmtInterfaceName)
addr, err := getIPThroughDHCP(getManagementInterfaceName(mgmtNetwork))
if err != nil {
return fmt.Sprintf("Requesting IP through DHCP failed: %s", err.Error()), nil
}
Expand Down Expand Up @@ -2602,14 +2602,14 @@ func configureInstallModeDHCP(c *Console) {
printToPanel(c.Gui, fmt.Sprintf("error applying network configuration: %s", err.Error()), installPanel)
}

_, err = getIPThroughDHCP(config.MgmtInterfaceName)
_, err = getIPThroughDHCP(getManagementInterfaceName(mgmtNetwork))
if err != nil {
printToPanel(c.Gui, fmt.Sprintf("error getting DHCP address: %s", err.Error()), installPanel)
}

// if need vip via dhcp
if c.config.Install.VipMode == config.NetworkMethodDHCP {
vip, err := getVipThroughDHCP(config.MgmtInterfaceName)
vip, err := getVipThroughDHCP(getManagementInterfaceName(mgmtNetwork))
if err != nil {
printToPanel(c.Gui, fmt.Sprintf("fail to get vip: %s", err), installPanel)
return
Expand Down
1 change: 1 addition & 0 deletions pkg/console/vip.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func getVipThroughDHCP(iface string) (*vipAddr, error) {
}

func getIPThroughDHCP(iface string) (net.IP, error) {
logrus.Infof("Get IP through DHCP via interface %s", iface)
broadcast, err := nclient4.New(iface)
if err != nil {
return nil, err
Expand Down
Loading