Ubuntu configuración de la tarjeta de red

Ubuntu cambiar el nombre de la tarjeta : ens3 => eth0

Paso 1: En primer lugar, cambiar a la cuenta de root y vi / etc / default / grub;

Paso 2: Parámetro GRUB_CMDLINE_LINUX añadió net.ifnames = 0 biosdevname = 0;

Paso 3: A continuación, guarde el archivo, ejecute el comando update-grub

Paso 4: Editar el archivo / etc / network / de interfaz guardar y reiniciar el sistema ubuntu

Paso 5: Por último verificar si la modificación se realiza correctamente


archivo de configuración de NIC : / etc / network / interfaces
modificaciones:
  1. a la modificación de la raíz
  autorización del comando sudo 2.


El contenido del archivo de configuración por defecto:

cheng@ubuntu:~$ sudo cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

Modificar, añadir dirección estática :

cheng@ubuntu:~$ sudo vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.40.14
gateway 192.168.40.1
netmask 255.255.255.0

Reiniciar la red :

cheng@ubuntu:~$ sudo /etc/init.d/networking --help
Usage: /etc/init.d/networking {start|stop|reload|restart|force-reload}

cheng@ubuntu:~$ sudo /etc/init.d/networking restart 
[ ok ] Restarting networking (via systemctl): networking.service.

Añadir una tarjeta eth1

auto  eth1
iface  eth1  inet  static
address  192.168.40.15
netmask  255.255.255.0
gateway  192.168.40.1
Publicado 63 artículos originales · ganado elogios 0 · Vistas 2188

Supongo que te gusta

Origin blog.csdn.net/qq_43058911/article/details/104989928
Recomendado
Clasificación