When I installed Ubuntu Server on one machine, the installation process skipped the step of network configuration, and When I logged in this machine via SSH on another machine, I was still unable to connect. Looking through the list of router DHCP Client Table, I found that the machine installing Ubuntu Server was not connected to the network, which was very strange.
$ifconfig
returns lo instead of eth0, which may be related to skipping network configuration during installation. Simply configure this machine to join the network normally.
$sudo pico /etc/network/interfaces
this will launch a simple text editor to edit Linux network configuration files
which you should see here:
auth lo
iface lo inet loopback
is exactly the lo loop. I need this machine running Ubuntu Server to get IP through DHCP to join the network. Then I just need to add the following configuration content of the lo loop above:
auth eth0
iface eth0 inet dhcp
press
Ctrl+O to save, press Ctrl+X to exit.
There are two ways to get your network configuration files into effect:
1, restart Ubuntu:
$sudo reboot
2, restart network components:
$sudo /etc/init.d/networking restart
as long as shown
Reconfiguring network interfaces… [OK]
is a successful restart of the network component.
if the IP is required instead of being obtained by DHCP
Manually specify the IP (such as 192.168.1.1) and specify the gateway (such as 192.168.1.254), then configure as follows:
Auth eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
if you are manually specifying IP and you also need to access the Internet, such as wget download, then you also need to set DNS:
$sudo pico /etc/resolv.conf
to add configuration content here:
nameserver xxx.xxx.xxx.xxx
just save.
The attached:
Fixing “Failed to bring up eth0” in Ubuntu
1.
sudo /etc/init.d/networking restart
2,
ifconfig -a
3,
sudo vi /etc/network/interface
4.
sudo /etc/init.d/networking restart
5,
ifconfig
or
sudo rm /etc/udev/rules.d/70-persistent-net.rulessudo rm /etc/udev/rules.d/70-persistent-net.rulessudo rm /etc/udev/rules.d/70-persistent-net.rulessudo rm /etc/udev/rules.d/70-persistent-net.rules
The network card is fine after the reboot.