2

I am running a server (Ubuntu 16.04) which has two network cards eno1 and eno2.

  • eno1 is connected to the outside and receives a public IP address over dhcp
  • eno2 is connected to a private network and receives a private IP address over dhcp (say 192.168.0.2 for simplicity)

The server netboots and receives everything from a second server on the private network (say 192.168.0.1). I follwed the Diskless Ubuntu HowTo and everything works pretty well.

  • the server gets 192.168.0.2 as ip address
  • then it loads the kernel and initramfs over tftp (from 192.168.0.1) and continues
  • later it mounts / which is also located on 192.168.0.1

With the last step there is however a problem. More or less simultaneously the system tries to get IP addresses for both eno1 and eno2, and sometimes eno1 finishes first. Then the system tries to find 192.168.0.1 through eno1, which it of course can't and times out.

As stated in the tutorial I included iface eno2 inet manual in my /etc/network/interfaces, to prevent eno2 from losing its address, but this does not seem to help.

Any idea how to force it to use eno2 instead of whichever network interface to use first

  • 1
    Are you using nfsroot? You can force the interface by adding that to the kernel command lineip=:::::eth0:dhcp. I'm not sure that you can use the enoX name at this early stage of boot, and you should try with eth0 or read the kernel log to find how the network interface is named at this stage of the boot. – pim Feb 28 '18 at 12:25
  • yes I am using nfsroot. The interface is (at least in my case) already known as enoX. – mbeyss Feb 28 '18 at 13:23
2

For a long answer, look at the nfsroot documentation.

The default behavior is to use the first interface configured for the nfsroot. In your case it is somehow random, since you've got two interface connected to two different networks.

You can force the network interface used for the nfsroot by adding this to the kernel command line : ip=:::::eno2:dhcp.

In case of the netboot tutorial this goes in the /tftboot/pxelinux.cfg/default file in the APPEND line. (Replaces the ip=dhcp)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.