linuxubuntu-11.04

ifup eth0 on every boot


04 and the network card is not supported by default kernel. So, I upgrade kernel to 3.2 and it support it. However, every time I reboot machine, need to sudo ifup eth0 to bring up it.

How can I modify some config to auto bring up eht0? (not write in /etc/rc.local, cause I mount NFS on /etc/fstab, it need to mount first than rc.local).


Solution

  • In Ubuntu you have to edit /etc/network/interfaces and set default configuration data for every network interface on your system.

    Put both auto and your interface name on a separate line before your interface configuration in order to bring it up at startup.

    Example: When your configuration is like this

    iface eth0 inet static
    address 192.168.1.5
    netmask 255.255.255.0
    gateway 192.168.1.254
    

    You have to change it to this

    auto eth0
    iface eth0 inet static
    address 192.168.1.5
    netmask 255.255.255.0
    gateway 192.168.1.254
    

    Network card configuration