08.21.2019

Dediserve network card failed

Some day ago, my server was gone down, I cannot SSH into server, when I went to console screen I saw that my server was gone into emergency mode.

I am using a flexible resource from dediserve, some day ago, I got a problem when connecting to my server

My server was went in to emergency mode, it show

You are in emergency mode. After logging in, type "journalctl -xb"to view system logs, "systemctl reboot" to reboot, "systemctl default" or "exit" to boot into default mode.
Press Enter for maintenance
(or press Control-D to continue)"

I logged in to check journalctl -xb

I found an error that show

[FAILED] Failed to start Raise network interfaces.
 See 'systemctl status networking.service' or journalctl -xe for details

I tried to bring network up by

ifup -v eth0

But I got error

Cannot find device "eth0"
Failed to bring up eth0.

Finally, I found solution from stackoverflow

I need to find correct device and change it from interfaces

Find correct network device by command

ip link

I got result like so

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

Result show me that my network device was ens3 not eth0

Went into /etc/networking, I did not see symbolic link named run so I created it

ln -s /run/network run

I did change from interfaces by

vim /etc/network/interfaces

and change it like below

auto lo
iface lo inet loopback

auto eth0 ens3
iface eth0 ens3 inet static
        address xxx.xxx.xxx.xxx
        netmask 255.255.255.0
        broadcast xxx.xxx.xxx.xxx
        network xxx.xxx.xxx.xxx
        gateway xxx.xxx.xxx.xxx

Restart networking

/etc/init.d/networking restart

Now check network to make sure it work correctly

ifconfig

It now show all correct network setting

Reboot server to escapse from Ubuntu emergency mode

Hope this can help in your case

Thank you for reading, happy coding

 

Leave a comment