Linux set the network card to boot up

Recently, I was learning Alpine Linux and installed it in VirtualBox. Because I wanted to be able to access the Internet and remotely manage the machine through SSH (for reasons, please refer to: VirtualBox configuration supports both Internet and local access ), a virtual network card was added.

 

Problem description :

Since Alpine can configure a network card by default during installation and enable it at boot, now I add a network card after installation. I don't know how to automatically enable it at boot?

 

Problem solved :

Since Alpine is a streamlined Linux distribution, it is not as smart as other Linux distributions to automatically load new network cards, so you need to manually edit the configuration file;

This and most other Linux distributions should be universal, participating in the configuration file:

File: /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
        hostname vir-alpine

Then execute the ifconfig -a command, find the network card you need to start up, and add it;

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
        hostname vir-alpine

auto eth1
iface eth1 inet dhcp
        hostname vir-alpine

Then the network card eth1 can be automatically enabled after the next restart.

Guess you like

Origin blog.csdn.net/juesystem/article/details/112980304