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.
Read More:
- Solve the problem of “wireless network activation failure” in Ubuntu 18, and repeatedly pop up the password input interface
- Solutions to network connection problems in Ubuntu 16.04.3
- 【Q&A】Failed to start LSB: Bring up/down networking
- VirtualBox Failed to start LSB:Bring up/down Networking problem
- How to Fix ubuntu phpmyadmin error: “Connection for controluser as defined in your configuration failed”
- Ubuntu 18.04/ubuntu 16.04 (Ubuntu kylin 18 / 16), the last grub installation failed
- Ubuntu18 “Activation of network connection failed” cannot access the Internet 【Solution】
- Solution to “error: invalid environment block” when Ubuntu starts up
- Solution: the network can be recovered only when the Ubuntu broadband is disconnected
- Mobaxterm connects to Ubuntu server through SSH network error: software caused connection abort
- Ubuntu 20.04 GPG: KeyServer receive failed: connection timed out when installing ROS configuration key
- OpenGL configuration under CodeBlocks in Ubuntu
- [Linux] failed to install libudev dev in Ubuntu 18.04
- Ubuntu 16.04 Chinese installation tutorial (Graphic), Ubuntu 16.04
- Ubuntu 20.04 connection failed activation of network connection failed
- When ifconfig configures the network, “siocsifaddr: no such device” and “eth0: error while getting interface” appear flags:No such dev”
- How to manually upgrade Ubuntu 16.04 LTS to Ubuntu 18.04 LTS, Part I
- Iphone network data is shared to ubuntu14.04 through ubs, which is a desktop computer and cannot be passed through hotspot
- Opencv2.4.9 + ffmpeg1.2.12 installation configuration and problem solution under Ubuntu 14.04
- The Ubuntu status bar shows the network speed, memory and CPU utilization ratio